Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select_one/select should raise exception immediately #114

Open
twall opened this issue Jul 14, 2020 · 0 comments
Open

select_one/select should raise exception immediately #114

twall opened this issue Jul 14, 2020 · 0 comments

Comments

@twall
Copy link

twall commented Jul 14, 2020

For those requests which provide a response queue, any raised exception caught by SqliteMultiThread should be posted to the queue instead of logged verbosely.

e.g.

                   try:
                        cursor.execute(req, arg)
                    except Exception as err:
                        if res:
                            res.put(err)
                            continue
                        else:
                            # An exception occurred in our thread, but we may not

With code like this in select:

            res = Queue()  # results of the select will appear as items in this queue
            self.execute(req, arg, res)
            while True:
                rec = res.get()
                if isinstance(rec, Exception):
                    raise rec
                if rec == '--no more--':
                    break
                yield rec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant