Skip to content

Commit

Permalink
add case exception message to internal exception to simplify error di…
Browse files Browse the repository at this point in the history
…scovery
  • Loading branch information
Arthur committed May 21, 2016
1 parent 3ad6780 commit 328417d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static DecodeBitmapResult decodeSampledBitmap(Context context, Uri uri, i
return new DecodeBitmapResult(bitmap, options.inSampleSize);

} catch (Exception e) {
throw new RuntimeException("Failed to load sampled bitmap: " + uri, e);
throw new RuntimeException("Failed to load sampled bitmap: " + uri + "\r\n" + e.getMessage(), e);
}
}

Expand Down Expand Up @@ -205,7 +205,7 @@ public static Bitmap cropBitmap(Context context, Uri loadedImageUri, float[] poi
fullBitmap.recycle();
}
} catch (Exception e) {
throw new RuntimeException("Failed to load sampled bitmap: " + loadedImageUri, e);
throw new RuntimeException("Failed to load sampled bitmap: " + loadedImageUri + "\r\n" + e.getMessage(), e);
}
}

Expand Down Expand Up @@ -315,7 +315,7 @@ private static Bitmap decodeSampledBitmapRegion(Context context, Uri uri, Rect r
}
} while (options.inSampleSize <= 512);
} catch (Exception e) {
throw new RuntimeException("Failed to load sampled bitmap: " + uri, e);
throw new RuntimeException("Failed to load sampled bitmap: " + uri + "\r\n" + e.getMessage(), e);
} finally {
closeSafe(stream);
if (decoder != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ public static Bitmap toOvalBitmap(Bitmap bitmap) {

/**
* Start an activity to get image for cropping using chooser intent that will have all the available
* applications for the device like camera (MyCamera), galery (Photos), store apps (Dropbox), etc.
* applications for the device like camera (MyCamera), galery (Photos), store apps (Dropbox), etc.<br>
* Use "pick_image_intent_chooser_title" string resource to override pick chooser title.
*
* @param activity the activity to be used to start activity from
*/
Expand All @@ -132,7 +133,8 @@ public static void startPickImageActivity(Activity activity) {
/**
* Create a chooser intent to select the source to get image from.<br>
* The source can be camera's (ACTION_IMAGE_CAPTURE) or gallery's (ACTION_GET_CONTENT).<br>
* All possible sources are added to the intent chooser.
* All possible sources are added to the intent chooser.<br>
* Use "pick_image_intent_chooser_title" string resource to override chooser title.
*
* @param context used to access Android APIs, like content resolve, it is your activity/fragment/widget.
*/
Expand Down

0 comments on commit 328417d

Please sign in to comment.