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

Catch unexpected errors during patch #6

Open
eagleeye opened this issue Mar 20, 2014 · 0 comments
Open

Catch unexpected errors during patch #6

eagleeye opened this issue Mar 20, 2014 · 0 comments

Comments

@eagleeye
Copy link
Contributor

When something is going wrong during patch, and error is not returned by callback, than i can't see before and after documents in error message, or at least before document. I think there should be try catch inside patch with fallback to general callback(catchedErr)

Just real example: One patched failed on 46% of progress, and it looks like document-specific problem, but i can't see that problematic document

ubuntu@ip-10-73-144-232 production-deployment ~ $ mongopatch debitoor-patch/patches/14w13/SB-7884-set-unpaidAmountCents-for-expenses --db
"$MONGOPATCH_STAGING2_DB" --log-db "$MONGOPATCH_LOG" --dry-run --parallel 25
Progress: [=======================> ] 40938/87229 46.9%
Patch: patch_20140319.091131.858_economic-staging-eu-2.expenses

Summary: Time 00h 07m 45s
ETA 00h 09m 01s (speed 87)
Modified 40938 (rest 0)
Skipped 0
Diff: added updated removed
unpaidAmountCents +40937 1 0
unpaidAmount 0 0 -1876
Cannot call method 'minus' of undefined
TypeError: Cannot call method 'minus' of undefined
at substractAmount (/home/ubuntu/debitoor-patch/patches/14w13/SB-7884-set-unpaidAmountCents-for-expenses/index.js:87:25)
at getUnpaidAmount (/home/ubuntu/debitoor-patch/patches/14w13/SB-7884-set-unpaidAmountCents-for-expenses/index.js:56:9)
at /home/ubuntu/debitoor-patch/patches/14w13/SB-7884-set-unpaidAmountCents-for-expenses/index.js:16:48
at null._ontransform (/usr/local/lib/node_modules/mongopatch/source/streams.js:222:3)
at ParallelTransform._transform (/usr/local/lib/node_modules/mongopatch/node_modules/parallel-transform/index.js:46:7)
at Transform._read (_stream_transform.js:179:10)
at Readable.read (_stream_readable.js:320:10)
at flow (_stream_readable.js:589:52)
at null. (_stream_readable.js:573:7)
at EventEmitter.emit (events.js:92:17)

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

No branches or pull requests

1 participant