diff --git a/lib/influxdb2/client/influx_error.rb b/lib/influxdb2/client/influx_error.rb index aad02a0..dde3873 100644 --- a/lib/influxdb2/client/influx_error.rb +++ b/lib/influxdb2/client/influx_error.rb @@ -32,7 +32,7 @@ def initialize(original = nil, message:, code:, reference:, retry_after:) def self.from_response(response) json = JSON.parse(response.body) - obj = new(message: json['message'] || '', code: response.code, reference: json['code'] || '', + obj = new(message: json['message'] || json['error'] || '', code: response.code, reference: json['code'] || '', retry_after: response['Retry-After'] || '') obj rescue JSON::ParserError