vampirelazarus / eveapi

Automatically exported from code.google.com/p/eveapi
0 stars 0 forks source link

Authentication errors throw an exception rather than parsing the error object returned #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Make a request such as :
https://api.eveonline.com/account/APIKeyInfo.xml.aspx?keyID=<key>&vCode=<vcode>

If the key is expired such that it returns error code 222, it will return a 
message and a 403 response.

<eveapi version="2">
  <currentTime>2014-01-19 05:14:54</currentTime>
  <error code="222">Key has expired. Contact key owner for access renewal.</error>
  <cachedUntil>2014-01-20 05:14:54</cachedUntil>
</eveapi>

The 403 response leads to an error, meaning I can't retrieve the error reason 
for the error to instruct the user.

com.beimin.eveapi.exception.ApiException: 
com.beimin.eveapi.exception.ApiException: java.io.IOException: Server returned 
HTTP response code: 403 for URL: 
https://api.eveonline.com/account/APIKeyInfo.xml.aspx
    at com.beimin.eveapi.connectors.ApiConnector.execute(ApiConnector.java:45)
    at com.beimin.eveapi.core.AbstractApiParser.getResponse(AbstractApiParser.java:49)
    at com.beimin.eveapi.core.AbstractApiParser.getResponse(AbstractApiParser.java:33)
    at com.beimin.eveapi.account.apikeyinfo.ApiKeyInfoParser.getResponse(ApiKeyInfoParser.java:27)
    at com.quickcamel.game.eve.kosoverlay.view.fx.controllers.SettingsController.validate(SettingsController.java:215)
    at com.quickcamel.game.eve.kosoverlay.view.fx.controllers.SettingsController.save(SettingsController.java:140)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)
    at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1446)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
    at javafx.event.Event.fireEvent(Event.java:171)
    at javafx.scene.Node.fireEvent(Node.java:6867)
    at javafx.scene.control.Button.fire(Button.java:179)
    at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
    at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
    at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
    at javafx.event.Event.fireEvent(Event.java:171)
    at javafx.scene.Scene$MouseHandler.process(Scene.java:3311)
    at javafx.scene.Scene$MouseHandler.process(Scene.java:3151)
    at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3106)
    at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
    at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2248)
    at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:194)
    at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:176)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.quantum.EmbeddedScene$2.run(EmbeddedScene.java:176)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
    at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
    at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
    at java.lang.Thread.run(Thread.java:744)
Caused by: com.beimin.eveapi.exception.ApiException: java.io.IOException: 
Server returned HTTP response code: 403 for URL: 
https://api.eveonline.com/account/APIKeyInfo.xml.aspx
    at com.beimin.eveapi.connectors.ApiConnector.getInputStream(ApiConnector.java:82)
    at com.beimin.eveapi.connectors.ApiConnector.execute(ApiConnector.java:43)
    ... 62 more
Caused by: java.io.IOException: Server returned HTTP response code: 403 for 
URL: https://api.eveonline.com/account/APIKeyInfo.xml.aspx
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at com.beimin.eveapi.connectors.ApiConnector.getInputStream(ApiConnector.java:80)
    ... 63 more

v5.1.2

Original issue reported on code.google.com by louis.bu...@gmail.com on 19 Jan 2014 at 5:41

GoogleCodeExporter commented 8 years ago
This currently blocks the following:
https://bitbucket.org/louisburton/kosoverlay/issue/13/improve-error-feedback-for
-bad-api-keys

Not sure how actively this is maintained and I def don't want to fork it, but 
if you need more info/help, please ask.

Original comment by louis.bu...@gmail.com on 19 Jan 2014 at 5:53

GoogleCodeExporter commented 8 years ago

Original comment by zyor.tae...@gmail.com on 19 Jan 2014 at 9:41

GoogleCodeExporter commented 8 years ago
Wow...a support contract would not fix and have it released quicker. Many 
thanks.

Original comment by louis.bu...@gmail.com on 19 Jan 2014 at 9:45