Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

fix(DynamicParser): Correctly handle throwing exceptions from method. #1064

Conversation

mvuksano
Copy link
Contributor

Fixes #971

@mvuksano mvuksano added cla: yes and removed cla: no labels May 24, 2014
it('should rethrow an error from a function', () {
expect(() {
parser("causeException()").eval(new TestData());
}).toThrow("Error");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marko,
What about those tests:

  • calling a method that does not exists ?
  • calling a method that exists but refers to a non-existent mehod / fiel ?

and making sure that the exception / message is the correct one (refer to the source exception). I have a PR pending on guiness to make it easier to test Exception (expect a type).

otherwise LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vicb Test for calling a method that does not exists is already there. I updated the test to throw a NoSuchMethodError instead of just Error. The idea of this TC is that any error that is thrown from a method should not be swallowed/modified. It does not necessarily need to be caused by a call to non existent method/field.

@vicb
Copy link
Contributor

vicb commented May 25, 2014

you're right Marko

@mvuksano mvuksano assigned vicb and unassigned vicb May 26, 2014
@@ -60,7 +60,7 @@ packages:
path:
description: path
source: hosted
version: "1.1.0"
version: "1.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this file from the PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the rationale for that ? (just to know, I have already committed updated lock files)

@mhevery
Copy link
Contributor

mhevery commented Jul 23, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

'Undefined function' when calling functions which throw exceptions
4 participants