category qosishsh to'g'irlandi
This commit is contained in:
@@ -24,11 +24,12 @@ use App\Jobs\Dashboard\Product\Child as ChildJob;
|
||||
use App\Jobs\Dashboard\Product\ChildUpdate as ChildUpdateJob;
|
||||
use App\Jobs\Dashboard\Product\Update as UpdateJob;
|
||||
use App\Jobs\Dashboard\Product\Deletes as DeletesJob;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Throwable;
|
||||
|
||||
class Controller extends ExController
|
||||
{
|
||||
@@ -97,10 +98,17 @@ class Controller extends ExController
|
||||
|
||||
$this->charSync($product, $request->characteristics);
|
||||
$this->dispatchSync(new ChildJob($request, $product));
|
||||
} catch (Exception $e) {
|
||||
} catch (Throwable $e) {
|
||||
Log::error('Product store failed', [
|
||||
'message' => $e->getMessage(),
|
||||
'category_id' => $request->get('category_id'),
|
||||
'trace' => $e->getTraceAsString(),
|
||||
]);
|
||||
|
||||
return Response::json([
|
||||
'status' => false,
|
||||
'messages' => $e->getMessage()
|
||||
'messages' => 'Product could not be saved.',
|
||||
'error' => config('app.debug') ? $e->getMessage() : null,
|
||||
], 500);
|
||||
}
|
||||
|
||||
@@ -341,10 +349,18 @@ class Controller extends ExController
|
||||
$this->dispatchSync(new ChildUpdateJob($request, $product));
|
||||
$this->charSync($product, $request->characteristics);
|
||||
$this->dispatchSync(new DeletesJob($request));
|
||||
} catch (Exception $e) {
|
||||
} catch (Throwable $e) {
|
||||
Log::error('Product update failed', [
|
||||
'product_id' => $product->id,
|
||||
'message' => $e->getMessage(),
|
||||
'category_id' => $request->get('category_id'),
|
||||
'trace' => $e->getTraceAsString(),
|
||||
]);
|
||||
|
||||
return Response::json([
|
||||
'status' => false,
|
||||
'messages' => $e->getMessage()
|
||||
'messages' => 'Product could not be saved.',
|
||||
'error' => config('app.debug') ? $e->getMessage() : null,
|
||||
], 500);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user