7

After looking into all options, it seems that ApexPages.Severity.FATAL and ApexPages.Severity.ERROR are exactly the same. Is there a difference that I'm not aware of?

  • I always used Error, but I think they behave the same, I am curious on what's the actual difference if there is. – raym0nd Mar 22 '16 at 20:29
  • I also use error, but I found a question while studying for Platform Developer II which gave a situation and asked if you should use error or fatal and then when I looked it up, I only saw documentation listing what the options are – brezotom Mar 22 '16 at 20:36
  • I have a feeling it's only to differentiate the severity of the error. So Fatal is basically a higher severity Error. – raym0nd Mar 22 '16 at 20:55
7

The Fatal level is intended to materialize errors that occur at the platform level, while the Error level is intended for errors that are not strictly fatal, which accounts for pretty much every error that we developers have control over. For example, a Fatal error might be when SOSL fails to run because the search sub-system is down, while a normal Error might be when the user types in an invalid date. In other words, you should generally be using Error, and leave Fatal alone.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.