File tree Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Expand file tree Collapse file tree 3 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -485,6 +485,7 @@ export class CellAdapter {
485
485
cellsStore . getState ( ) . setIsExecuting ( this . _id , false ) ;
486
486
return executeReplyMessage ;
487
487
} catch ( e ) {
488
+ cellsStore . getState ( ) . setIsExecuting ( this . _id , false ) ;
488
489
// If we started executing, and the cell is still indicating this execution, clear the prompt.
489
490
if ( future && ! cell . isDisposed && cell . outputArea . future === future ) {
490
491
cell . setPrompt ( '' ) ;
@@ -498,7 +499,6 @@ export class CellAdapter {
498
499
model . setMetadata ( 'execution' , timingInfo ) ;
499
500
}
500
501
}
501
- cellsStore . getState ( ) . setIsExecuting ( this . _id , false ) ;
502
502
throw e ;
503
503
}
504
504
}
Original file line number Diff line number Diff line change @@ -22,10 +22,7 @@ const btnStyle = {
22
22
marginTop : '20px'
23
23
}
24
24
25
- const CELL_CODE = `
26
- import time
27
- time.sleep(10)
28
- `
25
+ const CELL_CODE = `import time\ntime.sleep(3)`
29
26
30
27
const CellExecuteControl = ( ) => {
31
28
const [ executionDisable , setExecutionDisable ] = React . useState ( false ) ;
@@ -50,13 +47,13 @@ const CellExecuteControl = () => {
50
47
< Box style = { { marginTop : '20px' } } >
51
48
< Cell
52
49
id = '1'
53
- type = { 'code' }
50
+ type = 'code'
54
51
source = { CELL_CODE }
55
52
autoStart = { false }
56
53
showToolbar = { false } />
57
54
< Cell
58
55
id = '2'
59
- type = { 'code' }
56
+ type = 'code'
60
57
autoStart = { false }
61
58
showToolbar = { false } />
62
59
< Button
Original file line number Diff line number Diff line change @@ -258,11 +258,13 @@ export class KernelExecutor {
258
258
break ;
259
259
case 'error' :
260
260
{
261
- const { ename, evalue, traceback } = (
262
- content as any as KernelMessage . IErrorMsg
263
- ) . content ;
261
+ // NOTE: This block that was here previously cannot extract the properties consistently,
262
+ //causing the Promise to never be rejected in case of an execution error.
263
+ // const { ename, evalue, traceback } = (
264
+ // content as any as KernelMessage.IErrorMsg
265
+ // ).content;
264
266
this . _executed . reject (
265
- `${ ename } : ${ evalue } \n${ ( traceback ?? [ ] ) . join ( '\n' ) } `
267
+ `${ content . ename } : ${ content . evalue } \n${ ( content . traceback ?? [ ] ) . join ( '\n' ) } `
266
268
) ;
267
269
}
268
270
break ;
You can’t perform that action at this time.
0 commit comments