Show More
@@ -56,7 +56,11 b' class SessionRootHandler(IPythonHandler):' | |||
|
56 | 56 | try: |
|
57 | 57 | model = sm.create_session(name=name, path=path, kernel_name=kernel_name) |
|
58 | 58 | except NoSuchKernel: |
|
59 | raise web.HTTPError(400, "No such kernel: %s" % kernel_name) | |
|
59 | msg = ("The '%s' kernel is not available. Please pick another " | |
|
60 | "suitable kernel instead, or install that kernel." % kernel_name) | |
|
61 | status_msg = 'Kernel not found' | |
|
62 | msg = dict(full=msg, short=status_msg) | |
|
63 | raise web.HTTPError(400, json.dumps(msg)) | |
|
60 | 64 | |
|
61 | 65 | location = url_path_join(self.base_url, 'api', 'sessions', model['id']) |
|
62 | 66 | self.set_header('Location', url_escape(location)) |
@@ -185,32 +185,22 b' define([' | |||
|
185 | 185 | }); |
|
186 | 186 | |
|
187 | 187 | this.events.on('start_failed.Session',function (session, xhr, status, error) { |
|
188 | var msg = $('<div/>'); | |
|
189 | msg.append($('<div/>') | |
|
190 | .text('The kernel could not be started. This might ' + | |
|
191 | 'happen if the notebook was previously run with a kernel ' + | |
|
192 | 'that you do not have installed. Please choose a different kernel, ' + | |
|
193 | 'or install the needed kernel and then refresh this page.') | |
|
194 | .css('margin-bottom', '1em')); | |
|
195 | ||
|
196 | msg.append($('<div/>') | |
|
197 | .text('The exact error was:') | |
|
198 | .css('margin-bottom', '1em')); | |
|
199 | ||
|
200 | msg.append($('<div/>') | |
|
201 | .attr('class', 'alert alert-danger') | |
|
202 | .attr('role', 'alert') | |
|
203 | .text(JSON.parse(status.responseText).message)); | |
|
188 | var msg = JSON.parse(status.responseJSON.message); | |
|
204 | 189 | |
|
190 | that.save_widget.update_document_title(); | |
|
191 | $kernel_ind_icon.attr('class','kernel_dead_icon').attr('title','Kernel Dead'); | |
|
192 | knw.danger(msg.short, undefined, function () { | |
|
205 | 193 | dialog.modal({ |
|
206 | 194 | title: "Failed to start the kernel", |
|
207 | body : msg, | |
|
195 | body : msg.full, | |
|
208 | 196 | keyboard_manager: that.keyboard_manager, |
|
209 | 197 | notebook: that.notebook, |
|
210 | 198 | buttons : { |
|
211 | 199 | "Ok": { class: 'btn-primary' } |
|
212 | 200 | } |
|
213 | 201 | }); |
|
202 | return false; | |
|
203 | }); | |
|
214 | 204 | }); |
|
215 | 205 | |
|
216 | 206 | this.events.on('websocket_closed.Kernel', function (event, data) { |
General Comments 0
You need to be logged in to leave comments.
Login now