#@jedevc Are there common conventions for

1 messages ยท Page 1 of 1 (latest)

brazen surge
#

I've had a little look and it seems like quite a few have a base DaggerError

elder quiver
#

do you mean specifically in php? or across different sdks?

brazen surge
#

Python: ```
class DaggerError(Exception):
"""Base exception for all Dagger exceptions."""

#

across SDKs

#

Rust: #[derive(Error, Debug)] pub enum DaggerError { #[error("failed to build dagger internal graph")]

elder quiver
#

uh, so in go there's no real base class for them, since that's not really how go works ๐Ÿ˜›

brazen surge
#

Yeah, that's fair enough

elder quiver
#

if it's possible to have a base exception for all dagger-y errors, i think that makes sense

brazen surge
#

It is possible, so I could do that ๐Ÿ‘

elder quiver
#

there's no requirement to, it's just making the ergonomics for try-catching them a bit easier right?

#

you could catch all dagger-y errors

brazen surge
#

Right, I see.

#

So it's more the DX than the UX side of it

olive tusk
#

Yeah, it's common practice in a Python library to have a base exception, depends on the language's conventions. In our case it makes it easy to catch all dagger exceptions, like @elder quiver said, or to code in common behavior.

brazen surge
#

That's a good idea, I think I will implement similar soon

#

@olive tusk For Python, do you have any specific exceptions for end-users not formatting a module correctly?

More specifically, I am looking at making a clear exception for users who have not specified the subtype of their arrays on dagger functions

#

Ideally, I'll use the same name if it exists so it's easier for other maintainers to read.

#

Oh hold on, I think I found it: Is it a UserError?
(Sorry, Python is not my forte so I didn't spot it at first)