python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
'Unexpected token, expected ")"' on catch block when adding Typescript to ReactJS project?
I'm converting a ReactJS project to use Typescript. When I compile the project, on the catch block in try/catch statements,
...
} catch (e: any) {
console.log(e);
}
I get the following erro...
Buttlet
Votes: 0
Answers: 1
Try and except exit error after executing the except line
I am trying to exit out of the program after executing the except line. I have tried sys.exit(1) but it is not working. I am opening an .txt file and and passing it through the code. The code works pe...
watchtower
Votes: 0
Answers: 0
try-with-resource without declaring variable
I want to use try-with-resource to switch context but it seem try() can't use a resource without declaring a variable which makes the code less elegant. e.g.
class SwitchContext implements Closeable {...
user3369398
Votes: 0
Answers: 2
Unit Test C# Can we test catch block?
let's say i have a method that logins in;
public async Task<IActionResult> Login()
{
try
{
//my codes..
}
catch(Exception exp)
{
_sLogger.Slack(exp)
r...

coytex
Votes: 0
Answers: 1