chronograf icon indicating copy to clipboard operation
chronograf copied to clipboard

Error handling refactor

Open danielnelson opened this issue 9 years ago • 3 comments

Steps:

  1. Go to admin page
  2. Try to create database named oh"no

Expected: Database is created, or error displayed indicating the database name is invalid.

Actual: Page displays "Cannot communicate with server."

Server logs contain:

time="2017-05-24T12:17:57-07:00" level=error msg="Error message received status code 400 from server: err: error parsing query: found BADSTRING, expected ; at line 1, char 22" component=server http_status =400 
time="2017-05-24T12:17:57-07:00" level=info msg="Response: Bad Request" code=400 component=server remote_addr="[::1]:59956" response_time=1.289548ms 

danielnelson avatar May 24 '17 19:05 danielnelson

@danielnelson here is one of the error sites in the code: https://github.com/influxdata/chronograf/blob/master/influx/databases.go#L25

We'll need to run the escaping algorithm used in Influxql here:

https://github.com/influxdata/influxdb/blob/master/influxql/parser.go#L2930-L2933

goller avatar May 24 '17 20:05 goller

• Chose one common error reporting scheme • Remove promise based errors • Use error string when displaying errors.

See also https://github.com/influxdata/chronograf/issues/1301

nhaugo avatar Sep 05 '17 17:09 nhaugo

we now show this which i think is ok

image

russorat avatar Jul 20 '18 16:07 russorat