Skip to content

FileNotFoundErrors from ModResourceLoader now end with .yaml instead of .json #106

Description

@object-Object

For example:

│ C:\Users\object\Git\hexdoc\src\hexdoc\minecraft\recipe\recipes.py:74 in load_resource                                       │
│                                                                                                                             │
│    71 │                                                                                                                     │
│    72 │   @classmethod                                                                                                      │
│    73 │   def load_resource(cls, id: ResourceLocation, loader: ModResourceLoader):                                          │
│ ❱  74 │   │   return loader.load_resource(                                                                                  │
│    75 │   │   │   "data",                                                                                                   │
│    76 │   │   │   "recipe" if IsVersion(">=1.21") else "recipes",                                                           │
│    77 │   │   │   id,                                                                                                       │
│                                                                                                                             │
│ C:\Users\object\Git\hexdoc\src\hexdoc\core\loader.py:248 in load_resource                                                   │
│                                                                                                                             │
│   245 │   │   Raises FileNotFoundError if the file does not exist.                                                          │
│   246 │   │   """                                                                                                           │
│   247 │   │                                                                                                                 │
│ ❱ 248 │   │   resource_dir, path = self.find_resource(*args, **kwargs)                                                      │
│   249 │   │   return resource_dir, self._load_path(                                                                         │
│   250 │   │   │   resource_dir,                                                                                             │
│   251 │   │   │   path,                                                                                                     │
│                                                                                                                             │
│ C:\Users\object\Git\hexdoc\src\hexdoc\core\loader.py:307 in find_resource                                                   │
│                                                                                                                             │
│   304 │   │   │   │   if path.is_file():                                                                                    │
│   305 │   │   │   │   │   return resource_dir, path                                                                         │
│   306 │   │                                                                                                                 │
│ ❱ 307 │   │   raise FileNotFoundError(f"Path {path_stub} not found in any resource dir")                                    │
│   308 │                                                                                                                     │
│   309 │   @overload                                                                                                         │
│   310 │   def load_resources(                                                                                               │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: Path data\hexcasting\recipe\pride_colorizer_pansexual.yaml not found in any resource dir

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions