EIDA / eida-statistics

Aggregated statistics of EIDA nodes
GNU General Public License v3.0
0 stars 0 forks source link

Extra information at the top of CSV format #41

Closed javiquinte closed 1 year ago

javiquinte commented 1 year ago

I like "a lot" the extra lines with comments you included at the top of the CSV (#40 ). Could you please consider to include an extra piece of information? For instance: rejected or malformed parameters?

# request_parameters: start=2022-01&end=2022-12&details=month&format=csv
# rejected_parameters: groupby=day
jschaeff commented 1 year ago

I'm afraid that if parameters are wrong, user wont get any result.

For instance this URL gets a 400 return code. https://ws.resif.fr/eidaws/statistics/1/dataselect/public?start=2022-01&end=2023-01&aggregate_on=network,station,location,channel,month&format=json


<h1>400 Bad Request</h1><p>Invalid parameter 'aggregate_on'</p>
jschaeff commented 1 year ago

Maybe we should adapt the error message to the requested format:

javiquinte commented 1 year ago

No, I think you are totally right. If parameters are rejected and the query cannot be executed the user should receive a 40X code and no CSV. Just taking into account in the future in case that you feel that a query can be executed and returned without doubts of any type and an extra parameter was not used, or does not fit well. I'll just close the issue. Thanks!