uqbar-project / wollok

Wollok Programming Language
GNU General Public License v3.0
60 stars 16 forks source link

Native method exceptions are not being handled correctly. Not enough details #570

Closed javierfernandes closed 8 years ago

javierfernandes commented 8 years ago

For example:

captura de pantalla de 2015-12-26 14 32 43

javierfernandes commented 8 years ago

If the underlying exception was actually a wollok exception it should propagate it !

javierfernandes commented 8 years ago

Better error message now propagating wollok exception

>>> l.contains(2)
wollok.lang.Exception: Error while calling native method 'public java.lang.Object wollok.lang.WCollection.fold(org.uqbar.project.wollok.interpreter.core.WollokObject,org.uqbar.project.wollok.interpreter.core.WollokObject) with parameters: [Ljava.lang.Object;@d3f4505
    at wollok.lang.List.fold(initialValue,closure) [/wollok.wlk:436]
    at wollok.lang.Collection.any(predicate) [/wollok.wlk:248]
    at wollok.lang.Collection.contains(e) [/wollok.wlk:325]
    at  [/__synthetic0.wpgm:3]
    at  [/libForImports.wlk:9]
    at  [/libForImports.wlk:1]
Caused by: wollok.lang.Exception: Error while calling native method 'public org.uqbar.project.wollok.interpreter.core.WollokObject wollok.lang.Closure.doApply(org.uqbar.project.wollok.interpreter.core.WollokObject[]) with parameters: [Ljava.lang.Object;@6680f714
    at wollok.lang.Closure.apply(parameters) [/wollok.wlk:599]
    at wollok.lang.Collection.any(predicate) [/wollok.wlk:248]
    at wollok.lang.List.fold(initialValue,closure) [/wollok.wlk:436]
    at wollok.lang.Collection.any(predicate) [/wollok.wlk:248]
    at wollok.lang.Collection.contains(e) [/wollok.wlk:325]
    at  [/__synthetic0.wpgm:3]
    at  [/libForImports.wlk:9]
    at  [/libForImports.wlk:1]
Caused by: wollok.lang.Exception
    at wollok.lang.Integer.===(other) [/wollok.wlk:472]
    at wollok.lang.Object.==(other) [/wollok.wlk:101]
    at wollok.lang.Collection.contains(e) [/wollok.wlk:325]
    at wollok.lang.Closure.apply(parameters) [/wollok.wlk:599]
    at wollok.lang.Collection.any(predicate) [/wollok.wlk:248]
    at wollok.lang.List.fold(initialValue,closure) [/wollok.wlk:436]
    at wollok.lang.Collection.any(predicate) [/wollok.wlk:248]
    at wollok.lang.Collection.contains(e) [/wollok.wlk:325]
    at  [/__synthetic0.wpgm:3]
    at  [/libForImports.wlk:9]
    at  [/libForImports.wlk:1]