Kommentare zu: How to handle custom errors in M gracefully https://ssbi-blog.de/blog/technical-topics-english/how-to-handle-custom-errors-in-m-gracefully/ Wir lieben Microsoft Power BI Wed, 30 Sep 2020 08:22:59 +0000 hourly 1 https://wordpress.org/?v=6.7.2 Von: Lars Schreiber https://ssbi-blog.de/blog/technical-topics-english/how-to-handle-custom-errors-in-m-gracefully/#comment-1386 Wed, 30 Sep 2020 08:22:59 +0000 http://ssbi-blog.de/?p=2257#comment-1386 Als Antwort auf milang.

Thanks Milan,

I am aware of those possibilities. This solution is more a thought-provoking impulse than a mature, ready-made solution. 🙂

]]>
Von: milang https://ssbi-blog.de/blog/technical-topics-english/how-to-handle-custom-errors-in-m-gracefully/#comment-1385 Wed, 30 Sep 2020 08:16:35 +0000 http://ssbi-blog.de/?p=2257#comment-1385 Yes, I see the point.
Than maybe create a table for error thought Enter Data form in PQ with four columns (reason, message, detail, InternalDescription) convert it to records, and filter the record Id?
It would be easier to maintain.

]]>
Von: Lars Schreiber https://ssbi-blog.de/blog/technical-topics-english/how-to-handle-custom-errors-in-m-gracefully/#comment-1384 Wed, 30 Sep 2020 08:10:20 +0000 http://ssbi-blog.de/?p=2257#comment-1384 Als Antwort auf milang.

Hi Milan,

yeah, for sure. You’re right. In the development process, it was convenient to see the error messages in a table, but for the performance of the function your way is shorter, even though I don’t expect a big performance impact, because this error table won’t get thousands of rows long (I hope ;-P ). Thanks

Lars

]]>
Von: milang https://ssbi-blog.de/blog/technical-topics-english/how-to-handle-custom-errors-in-m-gracefully/#comment-1383 Wed, 30 Sep 2020 07:55:14 +0000 http://ssbi-blog.de/?p=2257#comment-1383 Maybe we do not have to convert error record to table.
Just filter the record by its id.
….
ErrorRecord = try ListCustomErrors{IDCustErr-1} otherwise error Error.Record( „Error ID not existing!“, „The error ID doesn’t exist! Use an existing one!“),
Result = error Error.Record( ErrorRecord[reason], ErrorRecord[message], ErrorRecord[detail] )
in
Result

]]>