| @@ -103,10 +103,13 @@ | ||
| 103 | 103 |      { | 
| 104 | 104 |          Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); | 
| 105 | 105 | |
| 106 | -        try { | |
| 106 | + try | |
| 107 | +        { | |
| 107 | 108 | // Try to delete file type from database - will throw error if foreign key is in use | 
| 108 | 109 | CustomerFileTypes::find($id)->delete(); | 
| 109 | -        } catch (\Illuminate\Database\QueryException $e) { | |
| 110 | + } | |
| 111 | + catch (\Illuminate\Database\QueryException $e) | |
| 112 | +        { | |
| 110 | 113 | // Unable to remove file type from the database | 
| 111 | 114 |              Log::warning('Attempt to delete file type ID '.$id.' by User '.Auth::user()->full_name.' failed.  Reason - ' . $e); | 
| 112 | 115 | return response()->json(['success' => false, 'reason' => 'In Use']); |