Skip to content

Commit e0166c5

Browse files
committed
updated error handling #366
1 parent 7701a9e commit e0166c5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/client/jupyter/kernel-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class KernelManagerImpl extends EventEmitter {
9898
hasKernelSpec = true;
9999
return this.startKernel(kernelSpec, language);
100100
}).catch(reason => {
101-
let message = `No kernel for language '${language}' found. Ensure you have a Jupyter or IPython kernel installed for it.`;
101+
let message = `Ensure you have a Jupyter/IPython and the prerequisites installed.`;
102102
let isCompatibilityIssue = false;
103103
if (typeof reason === 'object' && reason instanceof JmpModuleLoadError) {
104104
message = reason.message;

src/client/jupyter/zmq-kernel.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as child_process from 'child_process';
22
import * as path from 'path';
33
import * as fs from 'fs';
4-
import {Kernel} from './kernel';
4+
import { Kernel } from './kernel';
55
import * as vscode from 'vscode';
6-
import {KernelspecMetadata, JupyterMessage} from './contracts';
7-
import {JmpModuleLoadError} from '../common/errors';
6+
import { KernelspecMetadata, JupyterMessage } from './contracts';
7+
import { JmpModuleLoadError } from '../common/errors';
88
const uuid = require('uuid');
99

1010
export class ZMQKernel extends Kernel {
@@ -55,7 +55,12 @@ export class ZMQKernel extends Kernel {
5555
}
5656
catch (ex) {
5757
console.log(ex);
58-
throw new JmpModuleLoadError();
58+
if (typeof ex.message === 'string' && (ex.message as string).indexOf('Module version mismatch') > 0) {
59+
throw new JmpModuleLoadError();
60+
}
61+
else {
62+
throw ex;
63+
}
5964
}
6065
const jmp = this.jmp;
6166
const scheme = this.connection.signature_scheme.slice('hmac-'.length);

0 commit comments

Comments
 (0)