Skip to content

Discussion: More robust error handling #732

@peq

Description

@peq

Problem: Currently we crash the thread if there is an error ingame.
This can spoil the game so people are sad.

One idea is to take a more "Javascript like approach" and try to continue executing code.

Concretely, we have the following runtime exceptions created by the compiler:

  1. "Nullpointer exception when calling C.m"
  2. "Called C.m on invalid object."
  3. "Double free: object of type C"
  4. "Out of memory: Could not create C."
  5. "Index out of Bounds" (for multi-arrays)

Instead of crashing the thread, we could just print the error message and then

  • Return the default value from method m in cases 1 and 2.
  • Just continue after double frees (case 3)
  • Destroy a random object or the oldest object in case 4 and use that space for the new object.
  • Continue with a default value in case 5.

This issue for discussing which of those make sense, or whether we should keep the current behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions