Translated error messages

This commit is contained in:
Przemek Wiech
2020-09-12 20:04:42 +02:00
parent a886230305
commit 13b147f082
9 changed files with 68 additions and 9 deletions

10
src/util/error.ts Normal file
View File

@@ -0,0 +1,10 @@
/** Error class adding an error code used for i18n. */
export class TopolaError extends Error {
constructor(
public readonly code: string,
message: string,
public readonly args: {[key: string]: string} = {},
) {
super(message);
}
}