Skip to content

Commit

Permalink
Update Vue error info mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
yousif-bugsnag committed Jan 22, 2024
1 parent 187c3f1 commit a804ba6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/plugin-vue/src/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function formatComponentName (vm) {
// We copy in the following data structures from Vue's source so we can map the "info" parameter in the errorhandler
// callback (which is supplied as either a string or int) back to something meaningful

// https://github.com/vuejs/vue-next/blob/d5cce47789db8f37b9f5f8ea6602ea63e3a04b07/packages/runtime-core/src/component.ts#L153-L167
// https://github.com/vuejs/core/blob/f1068fc60ca511f68ff0aaedcc18b39124791d29/packages/runtime-core/src/enums.ts
const LifecycleHooks = {
BEFORE_CREATE: 'bc',
CREATED: 'c',
Expand All @@ -47,10 +47,11 @@ const LifecycleHooks = {
ACTIVATED: 'a',
RENDER_TRIGGERED: 'rtg',
RENDER_TRACKED: 'rtc',
ERROR_CAPTURED: 'ec'
ERROR_CAPTURED: 'ec',
SERVER_PREFETCH: 'sp'
}

// https://github.com/vuejs/vue-next/blob/d5cce47789db8f37b9f5f8ea6602ea63e3a04b07/packages/runtime-core/src/errorHandling.ts#L6-L24
// https://github.com/vuejs/core/blob/f1068fc60ca511f68ff0aaedcc18b39124791d29/packages/runtime-core/src/errorHandling.ts#L7-L25
const ErrorCodes = {
SETUP_FUNCTION: 0,
RENDER_FUNCTION: 1,
Expand All @@ -69,8 +70,9 @@ const ErrorCodes = {
SCHEDULER: 14
}

// https://github.com/vuejs/vue-next/blob/d5cce47789db8f37b9f5f8ea6602ea63e3a04b07/packages/runtime-core/src/errorHandling.ts#L26-L57
// https://github.com/vuejs/core/blob/f1068fc60ca511f68ff0aaedcc18b39124791d29/packages/runtime-core/src/errorHandling.ts#L27-L59
const ErrorTypeStrings = {
[LifecycleHooks.SERVER_PREFETCH]: 'serverPrefetch hook',
[LifecycleHooks.BEFORE_CREATE]: 'beforeCreate hook',
[LifecycleHooks.CREATED]: 'created hook',
[LifecycleHooks.BEFORE_MOUNT]: 'beforeMount hook',
Expand Down Expand Up @@ -100,5 +102,5 @@ const ErrorTypeStrings = {
[ErrorCodes.ASYNC_COMPONENT_LOADER]: 'async component loader',
[ErrorCodes.SCHEDULER]:
'scheduler flush. This is likely a Vue internals bug. ' +
'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next'
'Please open an issue at https://github.com/vuejs/core .'
}

0 comments on commit a804ba6

Please sign in to comment.