Mayur  Gujrathi

Mayur Gujrathi

  • 377
  • 4.1k
  • 1m

Get c# exception in typescript

Feb 8 2022 12:45 PM

I have my c# method , In the same I throwing exception in one of my case like below

throw new Exception("My Message");

And I am calling same endpoint from typescript , How can I get same message in typescript 

When I am catching the exception in typescript like below code , I am not getting same message which is thrown in c#.

It is givingme standard internal server error .

catch(error => {

            alert(error.response.data)

            alert(error)


Answers (4)