WingedSeal / jmc

A compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack
https://jmc.wingedseal.com
MIT License
64 stars 8 forks source link

[BUG] Unhandled Error #20

Closed bdke closed 1 year ago

bdke commented 1 year ago

Describe the bug

it does not return a valid error message

To Reproduce

setup invalid path

Expected behavior

throw an JMCError

Screenshots

NA

Desktop

Additional context


ValueError
'D:\\MultiMC\\instances\\1.19.4\\.minecraft\\saves\\New World\\datapacks\\main\\src\\main.jmc' is not in the subpath of 'F:\\MultiMC\\instances\\1.19.4\\.minecraft\\saves\\New World\\datapacks\\main' OR one path is relative and the other is absolute.
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Temp\ONEFIL~1\jmc\terminal_commands.py", line 62, in compile_
  File "C:\Users\User\AppData\Local\Temp\ONEFIL~1\jmc\compile\compiling.py", line 31, in compile_jmc
  File "C:\Users\User\AppData\Local\Temp\ONEFIL~1\jmc\terminal\configuration.py", line 125, in toJSON
  File "C:\Users\User\AppData\Local\Temp\ONEFIL~1\pathlib.py", line 818, in relative_to
ValueError: 'D:\\MultiMC\\instances\\1.19.4\\.minecraft\\saves\\New World\\datapacks\\main\\src\\main.jmc' is not in the subpath of 'F:\\MultiMC\\instances\\1.19.4\\.minecraft\\saves\\New World\\datapacks\\main' OR one path is relative and the other is absolute.

Please report this error at https://github.com/WingedSeal/jmc/issues/new/choose or https://discord.gg/PNWKpwdzD3
WingedSeal commented 1 year ago

Fixed (https://github.com/WingedSeal/jmc/commit/004f89cc999d0baff7f12415bebb986658a3c893)