error-or icon indicating copy to clipboard operation
error-or copied to clipboard

ErrorType of Cancelled

Open gslam2k opened this issue 1 year ago • 3 comments

Awesome videos and NuGet package. It would be nice to have a cancelled error type to handle the user cancelled scenarios for APIs etc

gslam2k avatar Aug 15 '22 13:08 gslam2k

Hi, you can use the NumericType property on Error with ErrorType.Custom. Then you can have your enum with other types of errors, like Cancelled, etc. Then you can check the error NumericType against this enum.

vpekarek avatar Aug 16 '22 05:08 vpekarek

I am doing this currently, but switching is a bit convoluted.

FAdrianJ avatar Aug 16 '22 16:08 FAdrianJ

@FAdrianJ, do you use the enum and your custom types together? Or do you use only your custom types and you find working with the NumbericType is convoluted?

amantinband avatar Sep 22 '22 14:09 amantinband