improvements on how error responses are generated for groovy procedures