PHP-036 / Beginner
Exposing exceptions or stack traces in user responses
Why is this a problem?
Internal paths, SQL and library versions provide clues for attackers.
How to fix it
php
} catch (\Throwable $e) {
report($e); // Server log
return response()->json(['message' => 'An error occurred during processing.'], 500);
}