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) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user