# `Code.LoadError`
[🔗](https://github.com/elixir-lang/elixir/blob/v1.20.1/lib/elixir/lib/exception.ex#L2056)

An exception raised when a file cannot be loaded.

This is typically raised by functions in the `Code` module, for example:

    Code.require_file("missing_file.exs")
    ** (Code.LoadError) could not load missing_file.exs. Reason: enoent

The following fields of this exception are public and can be accessed freely:

  * `:file` (`t:String.t/0`) - the file name
  * `:reason` (`t:term/0`) - the reason why the file could not be loaded

---

*Consult [api-reference.md](api-reference.md) for complete listing*
