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(
|
||||
(errorText: string, overrides?: IToast) => {
|
||||
(text: string, overrides?: IToast) => {
|
||||
setToast({
|
||||
title: 'Something went wrong',
|
||||
text: `We had trouble talking to our API. Here's why: ${errorText}`,
|
||||
text,
|
||||
type: 'error',
|
||||
show: true,
|
||||
autoHideDuration: 12000,
|
||||
|
@ -51,9 +51,7 @@ export class NotFoundError extends Error {
|
||||
statusCode: number;
|
||||
|
||||
constructor(statusCode: number = NOT_FOUND) {
|
||||
super(
|
||||
'The requested resource could not be found but may be available in the future'
|
||||
);
|
||||
super('The requested resource could not be found.');
|
||||
this.name = 'NotFoundError';
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user