本文整理匯總了TypeScript中util/UserNotification.error函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript error函數的具體用法?TypeScript error怎麽用?TypeScript error使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了error函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
const failCallback = (error) => {
let err_message = error.message;
let err_body = error.additional.body;
if (err_body && err_body.message) {
err_message = error.additional.body.message;
}
UserNotification.error(`Testing Grok pattern "${pattern.name}" failed with status: ${err_message}`,
"Could not test Grok pattern");
};
示例2:
promise.catch((errorThrown) => {
UserNotification.error('Details: ' + errorThrown,
'Could not try regular expression. Make sure that it is valid.');
});
示例3:
promise.catch((error) => {
if (error.additional.status !== 404) {
UserNotification.error("Loading widget information failed with status: " + error,
"Could not load widget information");
}
});
示例4:
}, (error) => {
if (error.additional.status !== 404) {
UserNotification.error("Delete user failed with status: " + error,
"Could not delete user");
}
});
示例5:
.catch(errorThrown => {
UserNotification.error("Loading message information failed with status: " + errorThrown,
"Could not load message information");
});
示例6:
promise.catch((errorThrown) => {
UserNotification.error('Details: ' + errorThrown, 'Could not check if lookup table translates the string');
});