-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rename catchError -> errorCaptured
- Loading branch information
Showing
2 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,12 @@ export function handleError (err: Error, vm: any, info: string) { | |
if (vm) { | ||
let cur = vm | ||
while ((cur = cur.$parent)) { | ||
if (cur.$options.catchError) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
yyx990803
Author
Member
|
||
if (cur.$options.errorCaptured) { | ||
try { | ||
const propagate = cur.$options.catchError.call(cur, err, vm, info) | ||
const propagate = cur.$options.errorCaptured.call(cur, err, vm, info) | ||
if (!propagate) return | ||
} catch (e) { | ||
globalHandleError(e, cur, 'catchError') | ||
globalHandleError(e, cur, 'errorCaptured hook') | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
errorCaptured looks like a boolean property. IMO the catchError is better than this one.