public function exitWithException($ex)
    {
        $response_data = [];
    
        $response_data["result"] = "error";
    
        $response_data["errors"] = [
            ["error_code" => "system_error", "error_text" => $ex->getMessage()]
        ];
    
        $this->sendJsonResponse($response_data);
        
        exit;
    }