Skip to main content

[datafx~datafx2:87] throw Exception rather than silently failing -- failfast!

  • From:
  • To:
  • Subject: [datafx~datafx2:87] throw Exception rather than silently failing -- failfast!
  • Date: Mon, 5 Aug 2013 08:43:15 +0000

Project:    datafx
Repository: datafx2
Revision:   87
Author:     johanvos
Date:       2013-08-05 08:43:43 UTC
Link:       

Log Message:
------------
throw Exception rather than silently failing -- failfast!


Revisions:
----------
87


Modified Paths:
---------------
datafx-core/src/main/java/org/datafx/reader/RestSource.java


Diffs:
------
diff -r e02e179dae79 -r 32134acb5411 
datafx-core/src/main/java/org/datafx/reader/RestSource.java
--- a/datafx-core/src/main/java/org/datafx/reader/RestSource.java       Fri 
Jul 26 02:18:10 2013 +0200
+++ b/datafx-core/src/main/java/org/datafx/reader/RestSource.java       Mon 
Aug 05 10:43:43 2013 +0200
@@ -5,7 +5,6 @@
 import java.io.OutputStreamWriter;
 import java.io.UnsupportedEncodingException;
 import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
 import java.net.URLEncoder;
@@ -147,6 +146,9 @@
                 for (Map.Entry<String, List<String>> entryList : 
getFormParams().entrySet()) {
                     String key = entryList.getKey();
                     for (String val : entryList.getValue()) {
+                        if (val == null ) {
+                            throw new IllegalArgumentException ("Values in 
form parameters can't be null -- was null for key "+key);
+                        }
                         if (!first) {
                             dataString = dataString + "&";
                         } else {
@@ -305,7 +307,7 @@
     public void writeBack() {
         try {
             createInputStream();
-        } catch (IOException ex) {
+        } catch (Exception ex) {
             Logger.getLogger(RestSource.class.getName()).log(Level.SEVERE, 
null, ex);
         }
     }






[datafx~datafx2:87] throw Exception rather than silently failing -- failfast!

johanvos 08/05/2013
 
 
Close
loading
Please Confirm
Close