ProjectError#
The reason a Project call doesn't fit the project's current state: there's no solved baseline, a baseline_id token is out of date, or the project needs a full reload. It reaches you wrapped in Error::Project. The project's state is unchanged when the call fails.
Declaration#
ProjectError is Copy and PartialEq, so it can be compared with ==. With the serde feature it also implements Serialize and Deserialize, as the same kebab-case strings that Display prints.
Variants#
| Variant | Display |
When it occurs |
|---|---|---|
NoBaseline |
no-baseline |
The project has no accepted baseline: it was never solved, or it was edited with apply after the last solve. Returned by preview, load_profile, evaluate, evaluate_with, suggest_assignments and roster. |
StaleBaseline |
stale-baseline |
A baseline_id passed to the call doesn't name the current accepted baseline, including when the project is unsolved. Returned by preview (options or changes token), apply (changes token), evaluate and evaluate_with (options token or any candidate's changes token), suggest_assignments and load_profile (options token). |
NeedsResync |
needs-resync |
An earlier apply rejected at least one operation, so the stored data may no longer match the caller's. Returned by solve(None), apply and level until solve(Some(data)) replaces the data. |
On calls that can return both NoBaseline and StaleBaseline, the baseline is checked first: an unsolved project gives NoBaseline even when a token is also passed.
Take the token from the latest solve result. See Project for which result carries baseline_id.
MatchError::Project from slots wraps the same type. See MatchError.
Example#
use ;
For recovery patterns, see Error handling.
Related#
Error- wraps this type inError::ProjectScheduleResult::baseline_id- the token aStaleBaselinecheck compares against- Previewing Changes - shows how to guard calls with baseline tokens
- Recover from rejected changes - shows how to clear
NeedsResync