Skip to content

Added error handling while adding daily-emissions in emissions chart.

rahulj3716 requested to merge rahulj3716/CarbonFootprint-API:issue_#151 into develop

Signed-off-by: rahulj3716 rahulj3716@gmail.com

Right now while adding emissions of any type we have no error handling.at some places, the user doesn't know what he has to enter and if he continues with some garbage value then also it doesn't throw any error on hitting submit button.

following changes are made in this PR:

  • Earlier user himself has to give the type of vehicle.but if he enters something different that is not in the database or some garbage value then it was showing no error. therefore we can provide him with all types in the form of dropdown.

    Screenshot_from_2020-03-09_13-06-49

  • Previously if the user doesn't enter origin and destination and submits the data then it shows no error. so, proper check is applied on required values.

    Screenshot_from_2020-03-09_13-07-37

  • earlier if the user enters invalid location and Microsoft maps API is not able to calculate the distance between them then it gives no error. Now it shows an error message.

    Screenshot_from_2020-03-09_13-08-29

  • after latest code change
    ezgif.com-optimize

Edited by rahulj3716

Merge request reports