# stage2: introduce Module.failed_root_source_file · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/2ed1ed9b32ae588f6a8997248d69817b5d89a133)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 2ed1ed9b32ae588f6a8997248d69817b5d89a133

Requested commit: 2ed1ed9b32ae588f6a8997248d69817b5d89a133

Commit: 2ed1ed9b32ae588f6a8997248d69817b5d89a133

Tree: 795a5929a71352c469fcd6018bb57ca5a3ebb20c

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: introduce Module.failed_root_source_file

Use case:

zig build-exe non_existent_file.zig

Previous behavior:

error.FileNotFound, followed by an error return trace

Behavior after this commit:

error: unable to read non_existent_file.zig: FileNotFound
(end of stderr, exit code 1)

This turns AllErrors.Message into a tagged union which now has the
capability to represent both "plain" errors as well as source-based
errors (with file, line, column, byte offset). The "no entry point found"
error has moved to be a plain error message.

```

## Parents

- [1c5606af9fdbfa18fb312a35a73c68515967c94d](https://git.cafe/gitcafe/zig/commit/1c5606af9fdbfa18fb312a35a73c68515967c94d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/2ed1ed9b32ae588f6a8997248d69817b5d89a133?format=markdown)
