# Is it possible to throw an error event using the engine API?

**URL:** <https://community.ofelia.com/t/is-it-possible-to-throw-an-error-event-using-the-engine-api/10468>\
**Category:** Q&A\
**Created:** [29 October 2020 15:09 UTC](https://community.ofelia.com/t/is-it-possible-to-throw-an-error-event-using-the-engine-api/10468 "2020-10-29T15:09:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unai.gaston.caminos](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/unai.gaston.caminos/32/1000_2.png) [@unai.gaston.caminos](https://community.ofelia.com/u/unai.gaston.caminos)\
**Post date:** [29 October 2020 15:09 UTC](https://community.ofelia.com/t/is-it-possible-to-throw-an-error-event-using-the-engine-api/10468/1 "2020-10-29T15:09:34Z")

</div>

Hi,

When it comes to error management at process level, I can have my failing connectors throw an error event and use a catch error event to automatically handle the situation.

Now, I would like to be able to catch the errors raised by my process outside a connector (e.g. in an operation, contract validation, ...). So, for lack of a better alternative, I was wondering whether I might force and throw an error event programmatically from within my operation/contract validation/... scripts.

- Is this possible at all?
- If so, how can it be done? (i.e. What sequence of classes/methods should I call?)
- Else, what alternatives do I have?

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [29 October 2020 15:21 UTC](https://community.ofelia.com/t/is-it-possible-to-throw-an-error-event-using-the-engine-api/10468/2 "2020-10-29T15:21:49Z")

</div>

Hello,

This is not possible at all or at least it would be highly hacky.

What is the use case?
