@@ -28,9 +28,11 @@ public static Dmi slurpUp(final File dmiFile) {
2828 try (InputStream input = new FileInputStream (dmiFile )) {
2929 return slurpUp (dmiFile .getName (), input );
3030 } catch (FileNotFoundException e ) {
31- throw new IllegalArgumentException ("Received DMI file doesn't exist" );
31+ throw new IllegalArgumentException ("Received DMI file doesn't exist. File path: " + dmiFile . getPath () );
3232 } catch (IOException e ) {
33- throw new IllegalArgumentException ("Received DMI can't be read" );
33+ throw new IllegalArgumentException ("Received DMI can't be read. File path: " + dmiFile .getPath ());
34+ } catch (Exception e ) {
35+ throw new RuntimeException ("Unable to slur up dmi file. File path: " + dmiFile .getPath ());
3436 }
3537 }
3638
@@ -44,7 +46,7 @@ public static Dmi slurpUp(final String dmiName, final String base64content) {
4446 try (InputStream input = new ByteArrayInputStream (Base64 .getMimeDecoder ().decode (base64content ))) {
4547 return slurpUp (dmiName , input );
4648 } catch (IOException e ) {
47- throw new IllegalArgumentException ("Received base64 content can't be read" );
49+ throw new IllegalArgumentException ("Received base64 content can't be read. Dmi name: " + dmiName );
4850 }
4951 }
5052
@@ -66,7 +68,9 @@ public static Dmi slurpUp(final String dmiName, final InputStream input) {
6668
6769 return new Dmi (dmiName , dmiImage .getWidth (), dmiImage .getHeight (), dmiMeta , dmiStates );
6870 } catch (IOException e ) {
69- throw new IllegalArgumentException ("Received DMI can't be read" );
71+ throw new IllegalArgumentException ("Received DMI can't be read. Dmi name: " + dmiName );
72+ } catch (Exception e ) {
73+ throw new RuntimeException ("Unable to slurp up dmi input. Dmi name: " + dmiName );
7074 }
7175 }
7276
0 commit comments