148 questions
0
votes
1
answer
163
views
Benthos yaml, catch http error, send to error topic
For Benthos yaml / pipeline what we developed, we will call http API, to handle the http exception, we can catch the error thru error(), then send to error topic, but it seems that the detailed http ...
2
votes
1
answer
129
views
How to get the current exception object in C++ Builder (replacement for ExceptObject)?
I am looking for a function/code that returns the current exception object. In other words, the exception object that represents the exception currently being handled (by the catch block).
For example:...
2
votes
1
answer
47
views
possible to delete a mongodb catch block
I have updated my mongodb driver which forces me to use two completion blocks: .then() .catch() instead of a single callback. The consequence of this is that any error in my stack down the line will ...
-1
votes
1
answer
77
views
JS: how to handle error from nested then() in outer catch block? [duplicate]
I am following a tutorial about handling errors of fetch() but now it turns to be learning handling errors. This is the code I wrote. I wish to handle all errors inside the outer catch:
fetch(...
1
vote
1
answer
266
views
Promise.catch() not catching errors from promise
I'm trying to check a number of conditions, and if one of them is true I want to proceed to a certain callback function. Otherwise, I want to proceed to a different callback function. Some pseudocode ...
1
vote
1
answer
829
views
'Await' cannot be used inside a 'Catch' statement, a 'Finally' statement, or a 'SyncLock' statement
I try to reproduce logic of C# program on my VB program, all going fine except one future, VB don't allow to reproduce this construction:
try
{
await nextButton[1].ClickAsync();
}
catch
{
...
0
votes
0
answers
267
views
Why am I catching a rejected Promise in a try/catch instead of the Error the Promise was rejected with?
Javascript in a webbrowser.
There is an async event handler. Inside this event handler a try/catch is used. Inside the try block an asynchoronous functions is called synchronously with await.
Inside ...
0
votes
1
answer
842
views
JavaScript Try Catch report errors in console only after program exits
This piece of code is supposed to loop forever until the user enters the correct answer in a prompt. The right answers are "left" and "right". If the user enters any other text, ...
0
votes
1
answer
69
views
Is it wise to have if logic inside a python catch block? [closed]
Consider the following method that checks if a parameter contains a valid UUID string and generates a new one if it isn't and if the option is set:
def validate_uuid(val, generate):
try:
...
0
votes
1
answer
95
views
Selecting Catch Block (in visual studio) with Regular Expression Search
I want to select all catch blocks (in my C# code in visual studio) using regular express search but unable to create a regular expression that selects all catch blocks (including empty blocks and ...
0
votes
1
answer
2k
views
Uncaught (in promise); Thrown error in fetch() not being caught
I've already read tons of resources to try to help me on this. This gist did not solve it for me (https://github.com/github/fetch/issues/203#issuecomment-266034180). It also seemed like this (...
2
votes
2
answers
1k
views
How to cover try/catch block in angular unit testing
checkDefault(event) {
try {
this.defaultCard = event.checked;
this.cardInfo.forEach((s) => {
if (s.isDefault && event.checked) {
const dialog = this....
0
votes
1
answer
600
views
How to cancel the observable calls when exist an error in rxjs observable sequence that is requiring sequencial execution?
I have a sequial list of observables is requiring sequencial execution (these are in concat operator but I can remove in forkjoin), but when error is happening I need to stop the sequential results. ...
-1
votes
1
answer
996
views
Why is `.then()` processed when fetch fails?
Consider the following code where I tried to shield fetch against any unsuccessful connections (I call them non "200-ish" in the comments) and provide a function that will make use of its ...
0
votes
0
answers
37
views
Type 'void | DiscordServer[]' is not assignable to type 'DiscordServer[]'
I'm getting this error while trying to call an async function. This is my code:
let result:DiscordServer[]
result = await Backendless.Data.of( backendlessDiscordServersTable! ).find<DiscordServer&...