Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to make it possible for errors to match #106

Closed
wants to merge 1 commit into from

Conversation

donovanh
Copy link

@donovanh donovanh commented Nov 3, 2016

The previous version would output the entire error object, making it impossible to match (with the file paths).

Using e.message instead makes sure the error matches. I believe it works with the intent of the test (and builds on the use of error.message earlier.

The previous version would output the entire error object, making it impossible to match (with the file paths).

Using `e.message` instead makes sure the error matches. I believe it works with the intent of the test (and builds on the use of `error.message` earlier.
@maurogestoso
Copy link

Yup, this solves the problem 👍

@darylshy
Copy link

darylshy commented Dec 31, 2016

this solution did not work for me. it reduced the output to the message property, while the program is still comparing the entire object.

"Unexpected token o in JSON at position 1" != "SyntaxError: Unexpected token o in JSON at position 1" "" != " at Object.parse (native)" != " at /usr/local/lib/node_modules/promise-it-wont-hurt/exercises/throw_an_error/solution/solution.js:6:20" != " at parsePromised (/usr/local/lib/node_modules/promise-it-wont-hurt/exercises/throw_an_error/solution/solution.js:4:10)" != " at Object.<anonymous> (/usr/local/lib/node_modules/promise-it-wont-hurt/exercises/throw_an_error/solution/solution.js:13:1)" != " at Module._compile (module.js:541:32)" != " at Object.Module._extensions..js (module.js:550:10)" != " at Module.load (module.js:458:32)" != " at tryModuleLoad (module.js:417:12)" != " at Function.Module._load (module.js:409:3)" != " at Module.runMain (module.js:575:10)"

@mansona
Copy link

mansona commented Jan 25, 2017

Is there any way we can get this merged? I have been working with someone and it's a bit of an impediment to progress when training.

It's especially hard when you're working with a relative beginner and you have to explain to them what a stack trace is when you're already working with complex concepts 😫

@donovanh
Copy link
Author

It doesn't look like this project is actively maintained. Last significant update was a year ago

screen shot 2017-01-25 at 10 00 10

@mansona
Copy link

mansona commented Jan 25, 2017

@donovanh thanks for the info, I'll reach out to steven 👍

@Vitormdias Vitormdias mentioned this pull request Jan 27, 2017
@traumverloren
Copy link

I cannot get passed this exercise due to this issue. It throws an error, but my stacktrace doesn't match the solution's, so indefinitely stuck here. 😭 Any way I can help?

@devserkan
Copy link

@traumverloren, change the original solution file as shown here: 95ac56a
Simply, you will change reject(e) with reject(e.message). After that if you try to verify your solution it will work.

@addaleax
Copy link
Collaborator

I think this has been fixed now, so I’m closing this. Please feel free to re-open if you run into any more trouble!

@addaleax addaleax closed this Oct 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants