[PATCH] [Kimchi] Bugfix 843: Add sourceURL comment for kimchi.min.js

- browser javascript debuggers cannot inspect dynamic loaded javascript because such scripts have no name (they are created with eval). The comment //# sourceURL=name is a way to solve it. - https://developer.chrome.com/devtools/docs/javascript-debugging Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com> --- ui/js/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/js/Makefile.am b/ui/js/Makefile.am index c9d1218..c24feeb 100644 --- a/ui/js/Makefile.am +++ b/ui/js/Makefile.am @@ -23,5 +23,6 @@ dist_js_DATA = kimchi.min.js $(filter-out kimchi.min.js, $(wildcard *.js)) kimchi.min.js: src/*.js cat $(sort $^) > $@ + echo "//# sourceURL=kimchi.min.js" >> $@ CLEANFILES = kimchi.min.js -- 1.9.1

Hi all, today I came across a doubt that I had never thought carefully before: What the right exception to return in a given code situation. I was returning "OperationFailed" instead of "InvalidParameter", when I received a higher value than expected during an update. Problem is that the first returns code '500' and the other '400', which are different in meaning. So, looking at the code, Wok has these return exceptions types (from wok/control/base.py): except MissingParameter, e: raise cherrypy.HTTPError(400, e.message) except InvalidParameter, e: raise cherrypy.HTTPError(400, e.message) except InvalidOperation, e: raise cherrypy.HTTPError(400, e.message) except UnauthorizedError, e: raise cherrypy.HTTPError(403, e.message) except NotFoundError, e: raise cherrypy.HTTPError(404, e.message) except OperationFailed, e: raise cherrypy.HTTPError(500, e.message) except WokException, e: raise cherrypy.HTTPError(500, e.message) You can have more information here: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes I would like to ask everybody to pay more attention in the exceptions you are using in your code and during the code reviews. If you find an exception somewhere that does not make sense, feel free to send a patch ;-] PS. Thanks Aline for the help. Regards, Rodrigo Trujillo

Applied. Thanks. Regards, Aline Manera
participants (3)
-
Aline Manera
-
Jose Ricardo Ziviani
-
Rodrigo Trujillo