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

tweak(scripting/v8): better error messages for ref calls #2781

Merged

Conversation

AvarianKnight
Copy link
Contributor

@AvarianKnight AvarianKnight commented Sep 9, 2024

Goal of this PR

Improve error messages when unpacking function unpacker

Currently if you error in this section of code on the server you get a hard to use stack trace that doesn't provide you any insights

image

How is this PR achieving the goal

  1. Cache the resource that originally called an export to x resource
  2. Catch unpack if it errors and return the default null
  3. Warn the end user if the resource recently restarted, or point them in the right direction as ref calls should only be invalidated on resource restart.

This PR applies to the following area(s)

ScRT: js

Successfully tested on

Game builds: N/A

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Sep 9, 2024
@prikolium-cfx prikolium-cfx added the ready-to-merge This PR is enqueued for merging label Sep 19, 2024
@prikolium-cfx prikolium-cfx merged commit 2337ae2 into citizenfx:master Oct 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR is enqueued for merging triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants