Refactored Exception Handling, mostly tested authorization request handler

* Internal error conditions now raise IndieAuthException
* Bubbled unknown exceptions converted to generic IndieAuthException
* Exceptions passed to overridable handler, turned into response
* Wrote many more tests, fixed a variety of problems
This commit is contained in:
Barnaby Walters
2021-06-09 00:06:35 +02:00
parent 61bc3d7418
commit 6d5e93b07c
10 changed files with 700 additions and 168 deletions

View File

@@ -53,7 +53,7 @@ class FilesystemJsonStorage implements TokenStorageInterface {
public function put(string $key, array $data): bool {
// Ensure that the containing folder exists.
@mkdir($this->path, 0777, true);
return file_put_contents($this->getPath($key), json_encode($data)) !== false;
}