Skip to content

Commit

Permalink
Handling error in change kernel rather than in select kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
Imam committed Aug 27, 2019
1 parent 5bf26c9 commit c5a67bc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/apputils/src/clientsession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ export class ClientSession implements IClientSession {
}
let session = this._session;
if (session && session.status !== 'dead') {
return session.changeKernel(options);
return session.changeKernel(options).catch(err => { this._handleSessionError(err); return Promise.reject(err);});
} else {
return this._startSession(options);
}
Expand Down Expand Up @@ -623,11 +623,7 @@ export class ClientSession implements IClientSession {
});
}
if (model) {
return this._changeKernel(model).then(() => undefined)
.catch( err => {
this._handleSessionError(err);
return Promise.reject(err);
});
return this._changeKernel(model).then(() => undefined);
}
})
.then(() => {
Expand Down

0 comments on commit c5a67bc

Please sign in to comment.