-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
139 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Thrown when the input is detected to be ungrammatical during the fix or | ||
* denote step. | ||
*/ | ||
export class Ungrammatical extends Error { | ||
constructor(message?: string) { | ||
super(message); | ||
this.name = 'Ungrammatical'; | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
} | ||
} | ||
|
||
/** | ||
* Thrown when Kuna doesn't know what a word means, and can't continue denoting | ||
* the sentence. | ||
*/ | ||
export class Unrecognized extends Error { | ||
constructor(message?: string) { | ||
super(message); | ||
this.name = 'Unrecognized'; | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
} | ||
} | ||
|
||
/** | ||
* Thrown in code paths that aren't expected to be reached by any input sentence | ||
* (so if this gets thrown, there's a bug in Kuna). | ||
*/ | ||
export class Impossible extends Error { | ||
constructor(message?: string) { | ||
super(message); | ||
this.name = 'Impossible'; | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
} | ||
} | ||
|
||
/** | ||
* Thrown in code paths that aren't handled yet. | ||
*/ | ||
export class Unimplemented extends Error { | ||
constructor(message?: string) { | ||
super(message); | ||
this.name = 'Unimplemented'; | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.