mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
This reverts commit 58f1af552e
.
This commit is contained in:
parent
863063f3e3
commit
57a764f057
165 changed files with 421 additions and 724 deletions
|
@ -8,13 +8,7 @@
|
|||
import { IHttpFetchError } from 'kibana/public';
|
||||
import { toasts, fatalError } from './notification';
|
||||
|
||||
interface CommonErrorBody {
|
||||
statusCode: number;
|
||||
message: string;
|
||||
error: string;
|
||||
}
|
||||
|
||||
function createToastConfig(error: IHttpFetchError<CommonErrorBody>, errorTitle: string) {
|
||||
function createToastConfig(error: IHttpFetchError, errorTitle: string) {
|
||||
// Expect an error in the shape provided by http service.
|
||||
if (error && error.body) {
|
||||
const { error: errorString, statusCode, message } = error.body;
|
||||
|
@ -25,7 +19,7 @@ function createToastConfig(error: IHttpFetchError<CommonErrorBody>, errorTitle:
|
|||
}
|
||||
}
|
||||
|
||||
export function showApiWarning(error: IHttpFetchError<CommonErrorBody>, errorTitle: string) {
|
||||
export function showApiWarning(error: IHttpFetchError, errorTitle: string) {
|
||||
const toastConfig = createToastConfig(error, errorTitle);
|
||||
|
||||
if (toastConfig) {
|
||||
|
@ -37,7 +31,7 @@ export function showApiWarning(error: IHttpFetchError<CommonErrorBody>, errorTit
|
|||
return fatalError.add(error, errorTitle);
|
||||
}
|
||||
|
||||
export function showApiError(error: IHttpFetchError<CommonErrorBody>, errorTitle: string) {
|
||||
export function showApiError(error: IHttpFetchError, errorTitle: string) {
|
||||
const toastConfig = createToastConfig(error, errorTitle);
|
||||
|
||||
if (toastConfig) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue