wizbots / labtab

0 stars 0 forks source link

Misleading error message(s) #142

Open internetmosquito opened 4 years ago

internetmosquito commented 4 years ago

Due to the latest change on the mentor API https://github.com/wizbots/wizbots/issues/2744 labtab in staging simply doesn't work because mentor can't login

Even worst is that the error shows says "No Internet connection", while it really has nothing to do with the problem at hand

Was debugging a bit and could see this stack trace

2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:37)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:25)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:117)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:211)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at retrofit2.OkHttpCall.execute(OkHttpCall.java:174)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.execute(ExecutorCallAdapterFactory.java:89)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at org.wizbots.labtab.retrofit.ConnectionUtil.execute(ConnectionUtil.java:20)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at org.wizbots.labtab.controller.LabTabHTTPOperationController.getMentorProfile(LabTabHTTPOperationController.java:52)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at org.wizbots.labtab.requesters.MentorProfileRequester.run(MentorProfileRequester.java:33)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
2020-02-23 01:05:03.667 4585-4898/org.wizbots.labtab W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
2020-02-23 01:05:03.668 4585-4898/org.wizbots.labtab W/System.err:     at java.lang.Thread.run(Thread.java:764)
2020-02-23 01:05:03.668 4585-4898/org.wizbots.labtab W/System.err: Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
2020-02-23 01:05:03.668 4585-4898/org.wizbots.labtab W/System.err:     at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
2020-02-23 01:05:03.668 4585-4898/org.wizbots.labtab W/System.err:     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:213)
2020-02-23 01:05:03.668 4585-4898/org.wizbots.labtab W/System.err:  ... 14 more

So this is clearly a problem with the mentor endpoint not returning data since we need to provide now mentor ID for that.

Having said that, please change error messages so they're not misleading. This is clearly an example of that. It should say something like:

"Internal error occured, Please contact Support and send logs to help troubleshoot the issue"