How to log exceptions in JavaScript

后端 未结 7 1495
太阳男子
太阳男子 2020-12-15 03:52

As a C# developer I\'m used to the following style of exception handling:

try
{
    throw SomeException(\"hahahaha!\");
}
catch (Exception ex)
{
    Log(ex.T         


        
7条回答
  •  一生所求
    2020-12-15 04:24

    It is almost identical, see the manual: https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Exception_Handling_Statements/try...catch_Statement

提交回复
热议问题