Refactor error responses in readFiles method to standardize status descriptions

This commit is contained in:
dhanabalan
2025-09-26 10:48:52 +05:30
parent 64237c3da0
commit 92a3b5a448

View File

@@ -85,8 +85,8 @@ class SapFileController extends Controller
if ($allFiles === false) { if ($allFiles === false) {
return response()->json([ return response()->json([
'status' => 'error', 'status' => 'error',
'message' => 'Failed to scan directory', 'status_description' => 'Failed to scan directory',
'debug' => ['path_checked' => $path] // 'debug' => ['path_checked' => $path]
], 500); ], 500);
} }
@@ -98,10 +98,7 @@ class SapFileController extends Controller
if (empty($files)) { if (empty($files)) {
return response()->json([ return response()->json([
'status' => 'error', 'status' => 'error',
'message' => 'No text files found', 'status_description' => 'No text files found',
'debug' => [
'scanned_files' => $allFiles
]
], 404); ], 404);
} }