diff --git a/dist/grip.js b/dist/grip.js index fe42fe5..55c2491 100644 --- a/dist/grip.js +++ b/dist/grip.js @@ -32,7 +32,7 @@ class Err extends Error { } } -class Ok extends Error { +class Ok { Ok() { return true; } @@ -42,6 +42,9 @@ class Ok extends Error { Of(cls) { return this instanceof cls; } + toString() { + return "Ok"; + } } class Result extends Array { diff --git a/grip.ts b/grip.ts index 24fbd1a..45faab1 100644 --- a/grip.ts +++ b/grip.ts @@ -1,4 +1,6 @@ -interface Status extends Error { +interface Status { + message?: string; + cause?: any; Ok(): boolean; Fail(): boolean; Of(cls: any): boolean; @@ -22,7 +24,7 @@ export class Err extends Error { } } -export class Ok extends Error { +export class Ok { Ok() { return true; } @@ -32,6 +34,9 @@ export class Ok extends Error { Of(cls: any) { return this instanceof cls; } + toString() { + return "Ok"; + } } interface IResult {