How to log exceptions in JavaScript

后端 未结 7 1501
太阳男子
太阳男子 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条回答
  •  萌比男神i
    2020-12-15 04:06

    I had a similar problem.

    Using console.table(error); worked well for me. It displays information in a table, and also lets me expand/collapse to see more details.

提交回复
热议问题