Maptool: Missing repository results in exception to the console

Created on 17 Sep 2019  Â·  10Comments  Â·  Source: RPTools/maptool

Describe the bug
Opening up a campaign with an invalid repo shows a lengthy exception message to the console.

To Reproduce
Steps to reproduce the behavior:

  1. Use gradlew to run Maptool with console
  2. Open up the Bag of Tricks or any other campaign with an invalid repo
  3. Look at the console, you will see an error message close to this one:
(AssetLoader.java:126) [Thread-20] ERROR net.rptools.maptool.model.AssetLoader - I/O error retrieving/saving index for 'https://dl.dropboxusercontent.com/u/9052014/W42-BOT-REPOSITORY/index.gz
java.io.FileNotFoundException: https://dl.dropboxusercontent.com/u/9052014/W42-BOT-REPOSITORY/index.gz
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1909) ~[?:?]
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509) ~[?:?]
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:245) ~[?:?]
        at java.net.URL.openStream(URL.java:1117) ~[?:?]
        at net.rptools.lib.FileUtil.getBytes(FileUtil.java:175) ~[main/:?]
        at net.rptools.maptool.model.AssetLoader.getIndexMap(AssetLoader.java:116) [main/:?]
        at net.rptools.maptool.model.AssetLoader.addRepository(AssetLoader.java:65) [main/:?]
        at net.rptools.maptool.model.AssetManager.updateRepositoryList(AssetManager.java:109) [main/:?]
        at net.rptools.maptool.client.MapTool.setCampaign(MapTool.java:954) [main/:?]
        at net.rptools.maptool.client.AppActions$63.run(AppActions.java:2345) [main/:?]

Expected behavior
The error message show either appear as a Maptool error message, or in the console as a warning.

MapTool Info

  • Version: 1.5.3, 1.5.4
  • Install: New

Desktop (please complete the following information):

  • OS: Windows
  • Version: 10
bug tested

Most helpful comment

Thanks, but I don't think an exception is ever the right choice for the user, even if it's documented.

I'd rather see a pop up that warns the user that the URL is not accessible and offers a checkbox so that the user isn't warned about this URL again. (Of course, the UI would need some way to turn off that checkbox at some point s well.)

I'm going to reopen so as to allow further discussion.

All 10 comments

Closed because from inspecting the code, I believe this is the intended behavior.

Thanks, but I don't think an exception is ever the right choice for the user, even if it's documented.

I'd rather see a pop up that warns the user that the URL is not accessible and offers a checkbox so that the user isn't warned about this URL again. (Of course, the UI would need some way to turn off that checkbox at some point s well.)

I'm going to reopen so as to allow further discussion.

User doesn't see the exception unless they are using the console.

@Merudo I think the point is that it shouldn't be throwing an exception to the console (where almost no one will see it) and that it should be letting the user know they have a bad repo in the campaign properties. Should probably prompt the user to Remove/Ignore the bad repo.

I'd suggest going one step further, and have the popup say

This repo doesn't work. I'm removing it from your list.

                                                    [ Kthx ]

I don't think remove/ignore is a meaningful choice for the user, and it introduces two new code paths that would have to be maintained instead of just one.

[EDIT] And don't show that popup if there's an update or autosave. And only show it once for all problem repos if there is more than one.

@pnichols04 I think automatically removing the repo is dangerous, especially since web services go temporarily offline every now and then.

I agree. A simple warning should do along with a brief description of how
to remove the offending repository.

On Wed, Sep 18, 2019 at 6:59 AM Merudo notifications@github.com wrote:

@pnichols04 https://github.com/pnichols04 I think automatically
removing the repo is dangerous, especially since web services go
temporarily offline every now and then.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/RPTools/maptool/issues/715?email_source=notifications&email_token=AABYNATFRYCHCJXRDYL6QMLQKIJZ7A5CNFSM4IXUXECKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD672AZA#issuecomment-532652132,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABYNAWCJLDSREMZYCE37ITQKIJZ7ANCNFSM4IXUXECA
.

The server should get the prompt I mentioned; the players should get a simple warning, “Repo not available”. Players may be behind firewalls or otherwise unable to get to a repo, but it should never be turned off completely for a player since they don’t have control over the Campaign object.

Are these error messages adequate:

When hosting server:

image

For the player:

image

Tested. Exception no longer output to console or log file. User gets warning that repo isn't accessible.

Was this page helpful?
0 / 5 - 0 ratings