本文整理汇总了TypeScript中@nteract/actions.launchKernelFailed函数的典型用法代码示例。如果您正苦于以下问题:TypeScript launchKernelFailed函数的具体用法?TypeScript launchKernelFailed怎么用?TypeScript launchKernelFailed使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了launchKernelFailed函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: mergeMap
mergeMap(msg => {
const c = msg.content;
const l = c.language_info;
const info: KernelInfo = {
protocolVersion: c.protocol_version,
implementation: c.implementation,
implementationVersion: c.implementation_version,
banner: c.banner,
helpLinks: c.help_links,
languageName: l.name,
languageVersion: l.version,
mimetype: l.mimetype,
fileExtension: l.file_extension,
pygmentsLexer: l.pygments_lexer,
codemirrorMode: l.codemirror_mode,
nbconvertExporter: l.nbconvert_exporter
};
let result;
if (!c.protocol_version.startsWith("5")) {
result = [
actions.launchKernelFailed({
kernelRef,
contentRef,
error: new Error(
"The kernel that you are attempting to launch does not support the latest version (v5) of the messaging protocol."
)
})
];
} else {
result = [
// The original action we were using
actions.setLanguageInfo({
langInfo: msg.content.language_info,
kernelRef,
contentRef
}),
actions.setKernelInfo({
kernelRef,
info
})
];
}
return of(...result);
})
示例2: catchError
catchError(error => {
return of(actions.launchKernelFailed({ error }));
})