Revert "[8.0] replace any with unknown in http client and types (#114265) (#117524)" (#117592)

This reverts commit 58f1af552e.
This commit is contained in:
Jonathan Budzenski 2021-11-04 15:18:29 -05:00 committed by GitHub
parent 863063f3e3
commit 57a764f057
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
165 changed files with 421 additions and 724 deletions

View file

@ -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) {