cervo_runtime/
error.rs

1// Author: Tom Solberg <tom.solberg@embark-studios.com>
2// Copyright © 2022, Tom Solberg, all rights reserved.
3// Created: 29 July 2022
4
5use crate::BrainId;
6use thiserror::Error;
7
8/// Errors that can be returned by Cervo Runtime.
9#[derive(Error, Debug)]
10pub enum CervoError {
11    #[error("unknown brain with id {0:?}")]
12    UnknownBrain(BrainId),
13
14    #[error("the runtime was cleared but the following brains still had data: {0:?}")]
15    OrphanedData(Vec<BrainId>),
16
17    #[error("internal error occured: {0}")]
18    Internal(anyhow::Error),
19}