your question is confusing. By definition, the catch block only runs if the try throws an error. You can't have a try block that throws no errors and a catch block that throws an error
n
neerajrtiwari
03/27/2019, 7:52 PM
The catch block caught the error but it does not send me the actual error I am thinking- instead it tells me "The author internal id or email must match an employee." in the body of the email sent to me. Both try and catch blocks has the nlapiSendEmail api with the same inactive employee as sender & myself as recipient of these emails.
b
battk
03/27/2019, 7:53 PM
are you sure its the nlapiSendEmail api thats sending the error and not the script error email
battk
03/27/2019, 7:54 PM
if you had the same code in the try and catch, both will throw errors and if uncaught, the error thrown from the catch will trigger the script error email
s
scottvonduhn
03/27/2019, 8:06 PM
The email you are getting is likely the system generated email when an error is thrown. The nlapiSendEmail call is not putting the error into the email body.
n
neerajrtiwari
03/27/2019, 9:45 PM
Sorry, just saw this. I believe that both of you are correct - I just have to troubleshoot more and find what's wrong.