Comments (7)
@llstarscreamll this is related to the Dingo API package, because they override the default Laravel Exception rendering.
I tried adding something like this:
if (!$request->expectsJson()) {
return app()->make(\Illuminate\Foundation\Exceptions\Handler::class)->render($request, $exception);
}
in the render()
function but didn't worked, I didn't spend enough time on it.
from apiato.
Hi @Mahmoudz, I have found a solution for this issue by making a small change on the app/Ship/Parents/Requests/RequestTrait.php
and setting API_PREFIX=api
, I have the PR ready but #115 should be merged first...
from apiato.
Hi...
I have been writing some tests for fix some bugs and features on the Web Authentication container, would be great to have this fixed to get better error display formatting on web routes. I tried to fix it, but was very confusing to me searching where the exceptions are triggered on web requests. Even try/catch on Task didn't work, the exception is ever triggered.
Thanks!!
from apiato.
Excuse me, try/catch works, I forgot include the exception class namespace on the controller. It's a ugly way but until the fix arrives, it would be like this:
<?php
namespace App\Containers\Authentication\UI\WEB\Controllers;
// ...
use App\Containers\Authentication\Exceptions\AuthenticationFailedException;
class Controller extends PortWebController
{
public function loginAdmin(LoginRequest $request, WebAdminLoginAction $action)
{
try {
$result = $action->run($request->email, $request->password, $request->remember_me);
} catch (AuthenticationFailedException $e) {
return redirect('/login')->with('status', $e->message);
}
if (is_array($result)) {
return redirect('/login')->with($result);
}
return redirect('/dashboard');
}
}
Off course, Form Requests still fail, no way to prevent it, unless we made validations within controller, but doesn't follow the PORTO conventions and is ugly++, jejeje.
from apiato.
Hi @Mahmoudz,
I have now correct web errors by setting API_PREFIX=api
on the .env
file, based on this Laracast question. I have tried 500 error from now, since there is a problem with Session on web routes and can't do much...
from apiato.
@llstarscreamll thank you man, I've merged your first PR, you're free to send this one anytime.
from apiato.
closed by #116
from apiato.
Related Issues (20)
- Composer require problem with requirements
- Installing on cPanel HOT 1
- Search is not working in RequestCriteria HOT 2
- Laravel Passport PKCE HOT 2
- microservice projects HOT 2
- Add Laravel 10 support HOT 6
- Swagger Generator HOT 2
- Your requirements could not be resolved to an installable set of packages
- how to handle relationship HOT 3
- UUID , instead of Hashed Id
- Hash ids error when using "in" operator HOT 2
- Cli generator does not support `criteria` currently
- Why i am getting "Welcome to Apiato" message even after specifying route end point HOT 1
- apiato:apidoc command throw ProcessFailedException Error HOT 9
- API Test Error: "The requested Resource was not found." HOT 5
- Custom Model primaryKey not working! HOT 2
- Installation Error via Composer
- No hint path defined for [mail] HOT 1
- Invalid key supplied HOT 2
- Repository delete() ModelNotFoundException is never thrown
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apiato.