Skip to content
New issue

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

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

Already on GitHub? # to your account

resourceError event doesn't work as it was in v1 #188

Closed
xxshady opened this issue Feb 19, 2024 · 2 comments
Closed

resourceError event doesn't work as it was in v1 #188

xxshady opened this issue Feb 19, 2024 · 2 comments

Comments

@xxshady
Copy link
Collaborator

xxshady commented Feb 19, 2024

code

import alt from 'alt-server'
alt.on('resourceError', (...args) => {
  alt.log('resourceError', args)
})

alt.setTimeout(() => {
  throw new Error('test')
}, 500)

v1

image

v2 (v1 compat)

image

@xLuxy
Copy link
Contributor

xLuxy commented Feb 21, 2024

Fixed in 3ef9644 - if you find anything missing feel free to re-open this issue.

@xxshady
Copy link
Collaborator Author

xxshady commented Feb 21, 2024

@xLuxy

line is incorrect, in v1 it shows exact line of throw, in v2 it shows line where closure is defined

alt.on('resourceError', (error, file, line, stack) => {
  alt.log('resourceError', {
    error,
    file,
    line,
    stack
  })
})

alt.setTimeout(() => { // 103
  alt.log("test")
  alt.log("test")
  throw new Error('test') // 106
}, 500)

v1:

image

v2:

image

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants