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

Handle errors inside the request hook methods (close #3786) #3868

Merged
merged 1 commit into from
Jun 13, 2019

Conversation

miherlosev
Copy link
Collaborator

@AndreyBelym @AlexKamaev @LavrovArtem

First - this PR, next - DevExpress/testcafe-hammerhead#2036

@VasilyStrelyaev check please messages in the error templates

@testcafe-build-bot
Copy link
Collaborator

`),

[TEST_RUN_ERRORS.requestHookNotImplementedError]: err => markup(err, `
You should implement the "${err.methodName}" method of the "${err.hookClassName}" class.
Copy link
Collaborator

Choose a reason for hiding this comment

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

        You should implement the "${err.methodName}" method in the "${err.hookClassName}" class.

`),

[TEST_RUN_ERRORS.requestHookUnhandledError]: err => markup(err, `
An unhandled error occurred inside the "${err.methodName}" method of the "${err.hookClassName}" class:
Copy link
Collaborator

Choose a reason for hiding this comment

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

        An unhandled error occurred in the "${err.methodName}" method of the "${err.hookClassName}" class:

@testcafe-build-bot
Copy link
Collaborator

@miherlosev miherlosev force-pushed the i3786 branch 2 times, most recently from e3a8307 to 98df355 Compare June 6, 2019 14:43
@testcafe-build-bot
Copy link
Collaborator

@testcafe-build-bot
Copy link
Collaborator

@testcafe-build-bot
Copy link
Collaborator

@miherlosev
Copy link
Collaborator Author

@testcafe-build-bot retest

@testcafe-build-bot
Copy link
Collaborator

@testcafe-build-bot
Copy link
Collaborator

@testcafe-build-bot
Copy link
Collaborator

@miherlosev
Copy link
Collaborator Author

@AndreyBelym @AlexKamaev @LavrovArtem you can review it. I will resolve conflict in the package.json file when I update the testcafe-hammerhead dependency.

@@ -1,4 +1,4 @@
import { pull as remove } from 'lodash';
import { pull, remove, chain } from 'lodash';
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really like pull, because here we definitely have two versions of remove, but since its lodash naming let it be so

_onRequestHookMethodError (event, hook) {
let err = event.error;

if (err instanceof RequestHookNotImplementedMethodError === false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just proposal, maybe this way is more clear.

const isRequestHookNotImplementedMethodError = err instanceof RequestHookNotImplementedMethodError

if (!isRequestHookNotImplementedMethodError ) {
...
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok. I will fix it.

@testcafe-build-bot
Copy link
Collaborator

@miherlosev
Copy link
Collaborator Author

@testcafe-build-bot retest

@testcafe-build-bot
Copy link
Collaborator

@miherlosev
Copy link
Collaborator Author

@testcafe-build-bot retest

@testcafe-build-bot
Copy link
Collaborator

@testcafe-build-bot
Copy link
Collaborator

@testcafe-build-bot
Copy link
Collaborator

@miherlosev
Copy link
Collaborator Author

@AndreyBelym @LavrovArtem FPR

@testcafe-build-bot
Copy link
Collaborator

@testcafe-build-bot
Copy link
Collaborator

@miherlosev miherlosev merged commit ae1c2ee into DevExpress:master Jun 13, 2019
@miherlosev miherlosev deleted the i3786 branch June 13, 2019 14:31
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this pull request Dec 18, 2019
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.

None yet

6 participants