All Questions
Tagged with exception javascript
810 questions
1
vote
1
answer
75
views
Silence some "helper" functions from the stack trace
I'm working on some algorithms that explore a tree (via recursion) to inspect and transform it. I'm using a number of helper functions to recurse: they validate input and output data, log stuff, ...
-2
votes
2
answers
57
views
Do all international browsers display the exception STACK in English or in the browser's native language?
This question is NOT about translating the content of a web page. It is about the Exceptions thrown in the JavaScript engine.
I am wondering if all international installations of browsers, installed ...
2
votes
3
answers
358
views
Uncaught Exception, even with Try Catch
After searching on SO, I could not find an answer to this problem. All of the questions I saw, the error was still being caught. I'm having the inverse problem. No matter how I refactor the following ...
2
votes
3
answers
105
views
How to handle unexpected errors thrown inside an async function?
Let's say there's an async function that has an implementation bug, for example:
function resolveAfter2Seconds() {
return new Promise((resolve) => {
setTimeout(() => {
...
0
votes
1
answer
919
views
Node JS / Javascript: Promise, uncaught exception not being handled by 'reject'
I set up the following to handle queries to a SQLite database. When there are no errors with the query, it performs as expected and all rows are logged to the console.
When I test the functionality ...
2
votes
2
answers
59
views
Why error in the "synchronous" part of promise/async function is handled differently
Compare these 2 snippets:
try {
console.log('start')
const test = (() => {
console.log('inside')
const a = null;
a.c = 1
})()
console.log('end')
} catch (...
-1
votes
1
answer
375
views
Don't report a fetch timeout as an uncaught exception
I use:
fetch("/test", { signal: AbortSignal.timeout(2000) })
.then(r => r.json())
.then(r => { console.log(r["data"]) });
with the method from Fetch API request ...
0
votes
1
answer
53
views
Error when trying to use addRange in Embedded Line Chart Builder
I am posting it here after trying multiple solutions.
My Data in Gsheet looks like
I am trying to draw an line Chart my code is below
var c_data = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(...
0
votes
0
answers
55
views
How to catch Javascript exceptions of type? [duplicate]
I wonder how can I implement Javascript exception of type. Let's suppose that I have a Javascript class, for example MyCustomException and I would like to have a try-catch where the catch would ...
1
vote
1
answer
464
views
Maui.net ExecuteScriptAsync(): Failed because a valid CoreWebView2 is not present
If I want to execute this method:
private async void GetSessionIdFromWebView()
{
sessionId = await webViewer.EvaluateJavaScriptAsync("MauiAppInterface.GetSessionId();");
}...
0
votes
0
answers
238
views
Playwright keep data when error is thrown in test
import {expect, test} from "@playwright/test";
test.describe('tests', () => {
let strings: string[] = [];
test('test 1', async () => {
strings.push('a');
...
0
votes
1
answer
443
views
Powerpoint add-in javascript api RichApi.Error: GeneralException
I am trying to build an add-in for MS PowerPoint so I decided to test an examples from the docs which is:
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/...
0
votes
1
answer
526
views
How much slower will try/catch be in Javascript?
I have a function that is called every frame and needs to finish within 16ms (sometimes it doesn't even manage). My team was dealing with occasional exceptions to this method, and I wanted to wrap it ...
0
votes
2
answers
115
views
Error management in nested async function calls [duplicate]
I am developing an Excel add-in using the Office JS API. I have a taskpane which is running code similar to the following:
var failA = true
var failB = true
// In reality this is Excel.run, and ...
0
votes
0
answers
9
views
Propagation of 'Can throw exception' tag on functions [duplicate]
While working on some projects, i've found out that when i split functionality between functions, it becomes difficult to find out, which functions can throw exception.
I can add comment to function, ...