semantic-router
semantic-router copied to clipboard
Re-raise LLM exceptions instead of raising new exception
In Python, re-raising exceptions (raise
instead of raise Exception(e)
preserves the original stack trace, helping with debugging.
Change the LLM __call__
exception handling to re-raise errors happening during generation
https://github.com/aurelio-labs/semantic-router/blob/f8fcd43a7018d6216668250ff99d9acbe7f16789/semantic_router/llms/openai.py#L53
@bruvduroiu so it should raise
instead of raise Exception(e)
?
@simjak yes, raise Exception(e)
raises a new exception, thus losing the stack of the original exception
Hey, great project. I'm looking to contribute (and generally getting started with contributing to OS), is this issue still unassigned?
Hey, great project. I'm looking to contribute (and generally getting started with contributing to OS), is this issue still unassigned?
Yes, you could contribute if you can 🙏