# Erratic behaviour when raising exception from foreign code

**URL:** <https://swi-prolog.discourse.group/t/erratic-behaviour-when-raising-exception-from-foreign-code/7480>\
**Category:** Help!\
**Tags:** how-to\
**Created:** [May 28, 2024, 3:29pm UTC](https://swi-prolog.discourse.group/t/erratic-behaviour-when-raising-exception-from-foreign-code/7480 "2024-05-28T15:29:08Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [May 28, 2024, 7:57pm UTC](https://swi-prolog.discourse.group/t/erratic-behaviour-when-raising-exception-from-foreign-code/7480/7 "2024-05-28T19:57:30Z")

</div>

> [@jan](#):
>
> That is a common issue when using `PL_scan_options()` when you want an additional check on the value.

I considered several times to just pick up the defines from sqlite and drop them in the Prolog wrapper of the sqlite bindings; then parse the options in Prolog and give the flags as an int. This creates yet another mixed layer though :-/

---

_[View the full topic](https://swi-prolog.discourse.group/t/erratic-behaviour-when-raising-exception-from-foreign-code/7480)._
