Skip to content

Commit

Permalink
Exception handling fix to throw correct instance of AndroidAutowireEx…
Browse files Browse the repository at this point in the history
…ception for missing required views.
  • Loading branch information
jacobhyphenated committed Feb 4, 2015
1 parent 5de735f commit c533023
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ private static void autowireViewsForFragment(Object thisFragment, Class<?> clazz
field.setAccessible(true);
field.set(thisFragment,view);
} catch (Exception e){
if(e instanceof AndroidAutowireException){
throw (AndroidAutowireException) e;
}
throw new AndroidAutowireException("Cound not Autowire AndroidView: " + field.getName() + ". " + e.getMessage());
}
}
Expand Down Expand Up @@ -298,6 +301,9 @@ private static void autowireViewsForClass(Activity thisActivity, Class<?> clazz)
field.setAccessible(true);
field.set(thisActivity,view);
} catch (Exception e){
if(e instanceof AndroidAutowireException){
throw (AndroidAutowireException) e;
}
throw new AndroidAutowireException("Cound not Autowire AndroidView: " + field.getName() + ". " + e.getMessage());
}
}
Expand Down

0 comments on commit c533023

Please sign in to comment.