-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add code client detail error [NEBULA-1511] (#4922)
* feat: add code client detail error * feat: update code client
- Loading branch information
1 parent
343c962
commit 1cb1fe5
Showing
6 changed files
with
82 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import { CustomError } from '../../../errors/custom-error'; | ||
|
||
const messagePrefix = 'There was a problem running Code analysis'; | ||
|
||
export class CodeClientError extends CustomError { | ||
constructor(statusCode: number, statusText: string, additionalUserHelp = '') { | ||
super(statusText); | ||
this.code = statusCode; | ||
this.userMessage = `${messagePrefix}. ${additionalUserHelp}\nContact support if the problem persists.`; | ||
} | ||
} | ||
|
||
this.userMessage = `There was a problem running Code analysis. ${additionalUserHelp}\nContact support if the problem persists.`; | ||
export class CodeClientErrorWithDetail extends CustomError { | ||
constructor(message: string, statusCode: number, detail: string) { | ||
super(message); | ||
this.code = statusCode; | ||
this.userMessage = `${messagePrefix}. ${detail}.`; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
export { MissingConfigurationError } from './missing-configuration-error'; | ||
export { FeatureNotSupportedBySnykCodeError } from './unsupported-feature-snyk-code-error'; | ||
export { CodeClientError } from './code-client-error'; | ||
export { | ||
CodeClientError, | ||
CodeClientErrorWithDetail, | ||
} from './code-client-error'; |
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