Quellcode durchsuchen

Add EmptyStackError class

This error will be thrown any time an item is supposed to be removed
from the stack, but can't due to it having no items.
ApisNecros vor 1 Jahr
Ursprung
Commit
86908450ab
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      src/errors.ts

+ 6 - 0
src/errors.ts

@@ -22,4 +22,10 @@ export class FailedToParseCodeBoxError extends StarfishError {
     constructor(badCodeBoxString: string|string[]|string[][]) {
         super("Failed to parse CodeBox input.\n"+util.inspect(badCodeBoxString));
     }
+}
+
+export class EmptyStackError extends StarfishError {
+    constructor() {
+        super("Unable to perform this operation on an empty stack");
+    }
 }