Skip to content

Commit

Permalink
feat: call function with multiple params
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezcarlosjr committed Jul 16, 2023
1 parent cee785a commit 45861cd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/notebook/shell/documentObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ export class DocumentObserver {
distinctUntilChanged((prev, curr) => prev.length === curr.length),
concatMap(async queue => {
const request = queue[queue.length-1];
const response = await callback(...request.arguments);
let response;
try {
response = await callback(...request.arguments);
} catch (e) {
// @ts-ignore
response = e.message;
}
await document.set(request.id, response);
}
)
Expand Down

0 comments on commit 45861cd

Please sign in to comment.