# Howto? throw and catch an error from "invoke method"

**URL:** <https://forum.radzen.com/t/howto-throw-and-catch-an-error-from-invoke-method/17690>\
**Category:** Blazor WebAssembly\
**Created:** [June 26, 2024, 12:34pm UTC](https://forum.radzen.com/t/howto-throw-and-catch-an-error-from-invoke-method/17690 "2024-06-26T12:34:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TMRGlobal](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/7993a0/32.png) [@TMRGlobal](https://forum.radzen.com/u/TMRGlobal)\
**Post date:** [June 26, 2024, 12:34pm UTC](https://forum.radzen.com/t/howto-throw-and-catch-an-error-from-invoke-method/17690/1 "2024-06-26T12:34:07Z")

</div>

hi guys,

super quick and probably very silly question,  
i'm invoking a custom method and i basically want to either succeed or throw an error which would enter the Radzen query builder error path (1.2)

 ![image](https://forum.radzen.com/uploads/default/original/3X/c/d/cd56b088346a4c0004aa856b2afe1ecb05efb7ca.png)

my code is as follows,

 ![image](https://forum.radzen.com/uploads/default/original/3X/9/a/9a20eb7f8d6df86189cfd67a7598296b9c844872.png)

is there a specific error type i need to throw on line 50? to be able to enter 1.2 ?

---

<div class="post-metadata">

**Author:** ![TMRGlobal](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/7993a0/32.png) [@TMRGlobal](https://forum.radzen.com/u/TMRGlobal)\
**Post date:** [June 27, 2024, 12:33am UTC](https://forum.radzen.com/t/howto-throw-and-catch-an-error-from-invoke-method/17690/2 "2024-06-27T00:33:23Z")

</div>

Got it, a bit of a tweak to the builder and minor adjustment to code, close this one off please

 ![image](https://forum.radzen.com/uploads/default/original/3X/6/7/67e1469f505e840d35df7a05fa1885bbe2c2c4e5.png)

 ![image](https://forum.radzen.com/uploads/default/original/3X/c/e/ce426a8c151d59cd8255f4964426b2cef30af2cf.png)
