Azure / azure-cosmosdb-js-server

The JavaScript SDK for server-side programming in Azure Cosmos DB
MIT License
179 stars 152 forks source link

Does Error accept one or two arguments? #23

Open johndowns opened 6 years ago

johndowns commented 6 years ago

The uniqueConstraint sample trigger, on lines 47, 60, 69, 105, 115, 121, and 134, throws a new Error with two arguments - an error code and a message. Similarly, the sum sample stored procedure does the same thing on lines 32 and 33.

It appears that Error can only be thrown with a single (message) argument though - and all other samples just use a single argument.

Which is correct?