bevyengine / bevyengine/bevy

Consistent User-Facing Errors

Open
#12,317 0 comments 0 reactions 0 assignees View on GitHub
C-Docs C-Usability
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## How can Bevy's documentation be improved?

## Current Status

As a user, there are multiple things I can do wrong, which are not (or can not) be prevented by the compiler.

In these cases, we either log a warning or error and might panic and abort.

Examples are when we have multiple mutating queries on the same component, or if we forget to initialize a resource or event.
For some of these, we also have error codes defined, which are listed on this page:

Currently, these messages are very inconsistent and might not provide enough information for the user to fix the issue.

## Desired Status

- _Every_ error that we cannot prevent statically, i.e. that the user might run into, should have an error code assigned and documented on . This makes it easier to refer to them and search them online.
- For example, we don't have an error code yet when the user forgets to initialize a resource. This can easily happen, especially to a beginner Bevy user.
- Add utility functions/types to generate warnings/errors in a unified format.
- This could be in a separate crate like `bevy_error`. Simple prototype (we probably would need to adjust the naming and structure):
- Maybe we can even make this usable by third-party plugins to define their own error messages in a similar format.
- The messages should link to the error page, so the user can easily obtain more info on how to fix the issue (see #12165).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.