How do you raise the error 'Insufficient string capacity'?
The OS error code listing includes
19 - String.setInt - Insufficient string capacity
How would you raise this error in the code for String.setInt? Specifically, what check could you do within the function that raises this error.
The simplest check I can think of is whether the string's max length is greater or equal to 5 (and thus has enough space to represent the maximum number of digits possible on the Hack computer). However this falls short for integers less than 5 characters in length which can be represented with smaller strings.
At the moment, I'm just letting the following error handle the overflow scenario...