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

error beep doesn't sound on some internal errors #1317

Closed
Dunbaratu opened this issue Dec 18, 2015 · 3 comments
Closed

error beep doesn't sound on some internal errors #1317

Dunbaratu opened this issue Dec 18, 2015 · 3 comments
Assignees
Labels
bug Weird outcome is probably not what the mod programmer expected.

Comments

@Dunbaratu
Copy link
Member

The purpose of the error beep was to warn the player when their script crashed and isn't in control of the ship anymore. A sort of "autopilot disengaged" warning.

But I'm finding a few circumstances where the beep does not occur on some exceptions. It seems to be exceptions that aren't derived from KOSException, such as when we have an error in our own code that throws a nullref. Regardless of whether the crash was the user's fault or our own, anything that stops the script needs to have the beep.

@Dunbaratu Dunbaratu added the bug Weird outcome is probably not what the mod programmer expected. label Dec 18, 2015
@Dunbaratu Dunbaratu self-assigned this Dec 18, 2015
@Dunbaratu
Copy link
Member Author

I strongly suspect that this issue and #1283 are actually related. It's because these exceptions aren't being sent through the same handler as the KOSExceptions. The exceptions thrown by the compiler are often just generic throw new Exception("yadda yadda"); statements inside the code that TinyPG builds, so they aren't derived from KOSException.

@Dunbaratu
Copy link
Member Author

An example of an error that has this problem is divide by zero. This command:
print 1 / 0.
will cause C# to produce a runtime exception that isn't derived from KOSException.

@Dunbaratu
Copy link
Member Author

In amending the comment above. it turns out that #1283 isn't the same issue after all. It is something different to be handled separately.

erendrake added a commit that referenced this issue Dec 27, 2015
…ons_beep_now

Fixes #1317 : now all logged exceptions can beep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Weird outcome is probably not what the mod programmer expected.
Projects
None yet
Development

No branches or pull requests

1 participant