1
0
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:
olav 2022-06-09 15:36:01 +02:00 committed by GitHub
parent 97206760be
commit 3add10ccbe
2 changed files with 3 additions and 5 deletions

View File

@ -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,

View File

@ -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;
} }