I'm having a little confusion around getting error...
# suitescript
k
I'm having a little confusion around getting errors create in Map/Reduce stage to appear in the iterator in the summarize stage. If I
throw
the
error.create
in the Map/Reduce stage i do have it in the iterator but it also shows as a system error in the Map/Reduce stage. I assumed that system errors would not show in the Map/Reduce stages and only show in the errors iterator in the summarize stage. Anyone have any clue about this?
b
what does your code look like
k
Copy code
if (value) {
  // Do My Stuff
} else {
  error.create()
}
That is basically what i am doing but have tried the below as well.
Copy code
if (value) {
  // Do My Stuff
} else {
  throw error.create()
}
Doing the second works but throw the error in the stage as well as summarize
b
you have to throw your error
k
ok but then why do i get an exception in logs. Do i have to wrap in a try catch to stop the exception in the stage
b
doesnt sound normal, share your code
k
Shared pirvately.