mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
refactor: simplify error toast text (#1081)
* refactor: simplify error toast text * refactor: simplify 404 error text
This commit is contained in:
parent
97206760be
commit
3add10ccbe
@ -12,10 +12,10 @@ const useToast = () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const setToastApiError = useCallback(
|
const setToastApiError = useCallback(
|
||||||
(errorText: string, overrides?: IToast) => {
|
(text: string, overrides?: IToast) => {
|
||||||
setToast({
|
setToast({
|
||||||
title: 'Something went wrong',
|
title: 'Something went wrong',
|
||||||
text: `We had trouble talking to our API. Here's why: ${errorText}`,
|
text,
|
||||||
type: 'error',
|
type: 'error',
|
||||||
show: true,
|
show: true,
|
||||||
autoHideDuration: 12000,
|
autoHideDuration: 12000,
|
||||||
|
@ -51,9 +51,7 @@ export class NotFoundError extends Error {
|
|||||||
statusCode: number;
|
statusCode: number;
|
||||||
|
|
||||||
constructor(statusCode: number = NOT_FOUND) {
|
constructor(statusCode: number = NOT_FOUND) {
|
||||||
super(
|
super('The requested resource could not be found.');
|
||||||
'The requested resource could not be found but may be available in the future'
|
|
||||||
);
|
|
||||||
this.name = 'NotFoundError';
|
this.name = 'NotFoundError';
|
||||||
this.statusCode = statusCode;
|
this.statusCode = statusCode;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user