Reputation: 1
I have installed aws-php-sdk in Laravel and configured it correctly where putitem / getitem working when executing through HTTP/HTTPS in the browser and curl. However, when I try to execute the same script through Laravel queue, I am getting this exceptions when trying to instantiate aws client:
local.ERROR: App\Jobs\processjob::failed(): Argument #1 ($exception) must be of type App\Jobs\Throwable, Error given, called in /var/www/html/myappname/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php on line 260 {"exception":"[object] (TypeError(code: 0): App\Jobs\processjob::failed(): Argument #1 ($exception) must be of type App\Jobs\Throwable, Error given, called in /var/www/html/myappname/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php on line 260 at /var/www/html/myappname/app/Jobs/processjob.php:46)
I am using AWS role permission to access dynamodb. I have tried to debug for hours with no luck. Please help!
Upvotes: -2
Views: 50
Reputation: 8102
The issue is very simple, processjob
class has a failed
method (overriden), and it is asking for Throwable $exception
, your issue is that Throwable
was not imported like a global class (\Throwable
) so the PHP thinks it is a class local to the current namespace (App/Jobs
).
So, your code should be like this:
function failed(\Throwable $exception)
or, another solution is:
On top of the file (after the namespace
keyword), write this: use \Throwable;
.
If this does not fix your problem, let me know and share your processjob
class, but this should do it...
Upvotes: 0