Forum Discussion
Ncio
Helper II
4 years agoCustom error messages?
Hello, One of my data source is an excel spreadsheet updated by the users. It's not very reliable and often generate error during the dataset refresh. It's often the same steps that fails a...
- 4 years ago
Hi Ncio,
You can throw custom error messages from PQ like thistry (StepWithPotentialError) otherwise error Error.Record("This is a custom error","I just love error messages")
try (X) otherwise Y returns X, unless X is an error. In the latter case, it returns Y.
error raises an error. You can writeerror "I just love error messages"or use a proper error record with
error Error.Record("This is a custom error","I just love error messages")Here is the email I've got from the PBI service
Showcase Report – Contoso By SpartaBI
SpartaBI
Community Champion
4 years agoHi Ncio,
You can throw custom error messages from PQ like this
try (StepWithPotentialError) otherwise error Error.Record("This is a custom error","I just love error messages")
try (X) otherwise Y returns X, unless X is an error. In the latter case, it returns Y.
error raises an error. You can write
error "I just love error messages"
or use a proper error record with
error Error.Record("This is a custom error","I just love error messages")
Here is the email I've got from the PBI service
Showcase Report – Contoso By SpartaBI
Ncio
Helper II
4 years agothank you!