Happy Business Starts Here

Raise meaningful error messages instead of NullPointerException when required fields are mi

Raise meaningful error messages instead of NullPointerException when required fields are mi

Related to this community message here 

https://community.zuora.com/t5/Zuora-CPQ/Why-System-NullPointerException-Argument-cannot-be-null-whi...

 

I've experienced similiar error messages from within Zuora's package while trying to programmatically build quotes. In the example above, Zuora's code did not properly handle a scenario when the Address1 field was missing from a Contact so it threw a NullPointerException.  I've received this same error message when the Initial Term wasn't populated on a Quote.

 

Zuora's code should never throw NullPointerExceptions. Instead it should throw meaningful exceptions such as 

 

throw new ZuoraRequiredFieldException("Address1 on BillToContact is null");

 

Don't leave us guessing as to which field on potentially several different objects hasn't met some criteria required by Zuora.

1 Comment
Savvy Scholar

I totally agree, there are many error messages that are hard coded in CPQ that the SF admin cannot update to be meaningful.  Provide more context within the message or allow the SF amin the ability to customize the error message, like the rules engine.