urbanopt / urbanopt-reopt-gem

Other
2 stars 3 forks source link

[REQUEST] Make API failure messages more descriptive #41

Closed dshen109 closed 3 years ago

dshen109 commented 3 years ago

Is your feature request related to a problem? Currently, the terminal gives very vague outputs when the REopt API call fails because the assumptions JSON has something wrong with it (in my case, I entered an invalid URDB label)

I, [2020-09-30T13:08:45.213932 #69942]  INFO -- : Submitting feature_report_Residential1_1 to REopt Lite API
I, [2020-09-30T13:08:49.524380 #69942]  INFO -- : Cannot write - /Users/dshen/Documents/NREL/code/urbanopt-reopt-telework-project/example_project/run/single_residential_scenario/1/reopt/feature_report_1_reopt_run.json
I, [2020-09-30T13:08:49.524463 #69942]  INFO -- : Could not optimize Feature Report Residential 1 1

Describe the solution you'd like A more descriptive error message would be nice, although I think this requires better responses from the REopt backend, since the error message in the output JSON says

Error. No optimization task has been created. See messages for more information. Note that inputs have default values filled in.
kflemin commented 3 years ago

I've added more output logging in the case errors are encountered in #89. I've also reformatted the JSON output that you alluded to in your request. Where it says "See messages for more information"...If you search for the 'messages' key near the bottom of the feature_report_X_reopt_run.json file, you will get much more information on the errors, warnings, and deprecations.