Skip to content

Conversation

@PierreSchwang
Copy link
Member

Overview

Fixes #2892

Description

Not completely happy with how it works - but that's just a limitation of the interface itself.
When not specifying the format, it'll be auto detected. Sadly, the interface outputs the command with the schem format specified (which now defaults to v3). But I've updated the exception handling to state that, if the schematic fails to load (the EOFException triggered, when loading a v2 schematic with the default schem was handled by the IOException block):
image

As I'd have to download the file either way when checking for the format, it's simply downloaded even if the format is specified. That way it can utilize the reset functionality of the underlying stream for the reader (v3 in particular). The Closer handles the deletion either way - so it shouldn't clog up anything nor be noticeable in any way.

### Submitter Checklist
- [x] Make sure you are opening from a topic branch (**/feature/fix/docs/ branch** (right side)) and not your main branch.
- [x] Ensure that the pull request title represents the desired changelog entry.
- [x] New public fields and methods are annotated with `@since TODO`.
- [x] I read and followed the [contribution guidelines](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md).

@PierreSchwang PierreSchwang requested a review from a team as a code owner August 29, 2024 20:00
@github-actions github-actions bot added the Bugfix This PR fixes a bug label Aug 29, 2024
@PierreSchwang
Copy link
Member Author

PierreSchwang commented Aug 29, 2024

I thought about adding a check if the format schem is specified (as the schematic interface spits the command out with that format explicitly set) and check the format either way - but that felt quite wrong

@Feniksovich
Copy link

I thought about adding a check if the format schem is specified (as the schematic interface spits the command out with that format explicitly set) and check the format either way - but that felt quite wrong

I agree with that, but I'm also afraid most users don't pay so much attention to commands syntax, what the each argument means or what schematics schemas actually exist (I'm not sure if the syntax of /schem command is documented anywhere).

For now, on my end I monitor /schem command execution and display the message with exact instructions and commands that can be executed to workaround current loading behavior (e.g. suggesting try /schem load fast.2 url:<code>).

@PierreSchwang
Copy link
Member Author

I thought about adding a check if the format schem is specified (as the schematic interface spits the command out with that format explicitly set) and check the format either way - but that felt quite wrong

I agree with that, but I'm also afraid most users don't pay so much attention to commands syntax, what the each argument means or what schematics schemas actually exist (I'm not sure if the syntax of /schem command is documented anywhere).

For now, on my end I monitor /schem command execution and display the message with exact instructions and commands that can be executed to workaround current loading behavior (e.g. suggesting try /schem load fast.2 url:<code>).

I guess it's already enough, that the more precise error is printed, when specifying the wrong format. That should help a bit - maybe (given the error is read)

@PierreSchwang PierreSchwang requested a review from a team September 3, 2024 21:16
@dordsor21 dordsor21 merged commit a1bea11 into main Sep 11, 2024
@dordsor21 dordsor21 deleted the fix/2892 branch September 11, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix This PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error on loading schematics v2 from URL

5 participants