-
Notifications
You must be signed in to change notification settings - Fork 32
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
1 parent
faaff72
commit c15a838
Showing
186 changed files
with
23,381 additions
and
24,368 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,35 @@ | ||
import { TextLocation } from '@creditkarma/thrift-parser' | ||
import { emptyLocation } from './utils' | ||
|
||
export const enum ErrorType { | ||
ValidationError = 'ValidationError', | ||
ResolutionError = 'ResolutionError', | ||
GenerationError = 'GenerationError', | ||
} | ||
|
||
export interface IThriftError { | ||
type: ErrorType | ||
message: string | ||
loc: TextLocation | ||
} | ||
|
||
export class ValidationError extends Error { | ||
public message: string | ||
public loc: TextLocation | ||
constructor(msg: string, loc: TextLocation) { | ||
super(msg) | ||
this.message = msg | ||
this.loc = loc | ||
} | ||
} | ||
|
||
export function createValidationError( | ||
message: string, | ||
loc: TextLocation = emptyLocation(), | ||
): IThriftError { | ||
return { | ||
type: ErrorType.ValidationError, | ||
message, | ||
loc, | ||
} | ||
} |
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.