update message format

prevent response is undefined
This commit is contained in:
ericchanky 2021-11-26 13:02:52 +08:00 committed by GitHub
parent a38f7f0c82
commit 80f4a98492
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -361,8 +361,8 @@ class Monitor extends BeanModel {
} catch (error) {
if (axios.isAxiosError(error)) {
bean.msg = JSON.stringify(error.response.data);
if (axios.isAxiosError(error) && error.response) {
bean.msg = `${error.message}, ${JSON.stringify(error.response.data)}`;
} else {
bean.msg = error.message;
}