Open d-woosley opened 2 months ago
Hi, Thank you for your suggestion I also think it would be useful to raise custom errors! Could you create a pull request for this? Best regards,
So sorry for the delayed response! I got a bit behind and had to switch projects. I will work on this when I can get to it next but it will likely be a little while (a few months).
I would love to see pwndocapi raise errors instead instead of just printing if in verbose. For example, I've been working on a script that will use the API to pull down a CSV but some users have MFA enabled. MFA support was added in my last pull, but I would like to be able to attempt the login, and if it fails, prompt for a TOTP and login again. However, I would like to only prompt for a TOTP if the failure is due to the lack of TOTP and not another general issue like a bad network connection or incorrect credentials.
Something like the following:
New Error Classes:
Code Update Example:
Implementation in other scripts:
I'm happy to work on this change and submit a pull, but I want to make sure this change is in-line with what is wanted for the project in general as this change could break other scripts. Of course, I can always fork pwndocapi and use my own copy, but I wanted to give back to the project if possible.