travisghansen / phpgpg

Support PGP operations in PHP
9 stars 4 forks source link

Re-Added Exceptions #2

Closed otherguy closed 3 years ago

otherguy commented 9 years ago

Hey,

I re-added the exceptions because I think it's better to do the exception handling in the actual app than in the package. Right now, it just returns false in case of an exception, taking away any chance of seeing what caused the issue.

Let me know what you think.

Cheers!

travisghansen commented 9 years ago

@darkwinternight yes my intention was to do this eventually. I like where you're going here but my intention is to do similar to gpgme/PDO and allow setting a generic error mode on the resource. Then let each adapter implement/return as appropriate. Do you have any interest in re-tooling/helping with that effort?

otherguy commented 9 years ago

Sure, I can take that on. Want me to leave this pull request open and change the title or do you want to close it and have me submit a new one?

travisghansen commented 9 years ago

@darkwinternight ok cool. Let me get some scaffolding in place that you can merge in, then you can take over and start implementing in the adapters. I'll ping here with the details after I get something put together.

Thanks!

travisghansen commented 9 years ago

@darkwinternight have a look at ee0a8dd8d9a77021befd5f18d980450062d622fb

Now we need to come up with some sane rules for what to return when. I've stubbed out a PhpGpg\Exceptions\Exception class which I think all exceptions should return newly created class that extend that base exception.