Refactor error responses in readFiles method to standardize status descriptions
This commit is contained in:
@@ -85,8 +85,8 @@ class SapFileController extends Controller
|
||||
if ($allFiles === false) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Failed to scan directory',
|
||||
'debug' => ['path_checked' => $path]
|
||||
'status_description' => 'Failed to scan directory',
|
||||
// 'debug' => ['path_checked' => $path]
|
||||
], 500);
|
||||
}
|
||||
|
||||
@@ -98,10 +98,7 @@ class SapFileController extends Controller
|
||||
if (empty($files)) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'No text files found',
|
||||
'debug' => [
|
||||
'scanned_files' => $allFiles
|
||||
]
|
||||
'status_description' => 'No text files found',
|
||||
], 404);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user