Error handling refactor
Steps:
- Go to admin page
- 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 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
• 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
we now show this which i think is ok
