Use custom exception types
KennethHoff opened this issue · comments
I noticed that in various places (GitHub search) you are throwing the base Exception
type, which is not recommended.
Would it be possible to create a custom base Exception like SanityException
and whenever you throw, throw an Exception that derives from it?
Here for example, you could throw a SanitySerializationException
such that we - as a consumer of this library - can utilize the catch (SanityException ex)
or catch (SanitySerializationException ex)
syntaxes.
sanity-linq/src/Sanity.Linq/SanityClient.cs
Lines 234 to 237 in 170cd80