Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Throw a 410. Don't report it.
James Coleabacfa212e6f
diff --git a/app/Api/V1/Controllers/Models/Transaction/StoreController.php b/app/Api/V1/Controllers/Models/Transaction/StoreController.phpindex 99aa685815..9f683f6916 100644--- a/app/Api/V1/Controllers/Models/Transaction/StoreController.php+++ b/app/Api/V1/Controllers/Models/Transaction/StoreController.php@@ -24,7 +24,6 @@ declare(strict_types=1);namespace FireflyIII\Api\V1\Controllers\Models\Transaction;-use FireflyIII\Models\TransactionGroup;use Illuminate\Http\Request;use FireflyIII\Api\V1\Controllers\Controller;use FireflyIII\Api\V1\Requests\Models\Transaction\StoreRequest;@@ -45,7 +44,7 @@ use Illuminate\Support\Facades\Log;use Illuminate\Support\Facades\Validator;use Illuminate\Validation\ValidationException;use League\Fractal\Resource\Item;-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;+use Symfony\Component\HttpKernel\Exception\HttpException;/*** Class StoreController@@ -133,10 +132,9 @@ class StoreController extends Controller->withAPIInformation();- /** @var TransactionGroup $selectedGroup */$selectedGroup = $collector->getGroups()->first();if (null === $selectedGroup) {- throw new NotFoundHttpException();+ throw HttpException::fromStatusCode(410,'200032: Cannot find transaction. Possibly, a rule deleted this transaction after its creation.');}// enrichdiff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.phpindex e17ced5d89..3089ca41b7 100644--- a/app/Exceptions/Handler.php+++ b/app/Exceptions/Handler.php@@ -45,6 +45,7 @@ use Override;use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;+use Symfony\Component\HttpKernel\Exception\GoneHttpException;use Symfony\Component\HttpKernel\Exception\HttpException;use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;@@ -71,6 +72,7 @@ class Handler extends ExceptionHandlerAuthenticationException::class,LaravelValidationException::class,NotFoundHttpException::class,+ GoneHttpException::class,OAuthServerException::class,LaravelOAuthException::class,TokenMismatchException::class,