Skip to content

Commit b96232b

Browse files
authored
Feat: implement Error for ProgramError (#231)
implement Error for ProgramError
1 parent 1d26463 commit b96232b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sdk/pinocchio/src/program_error.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,3 +283,14 @@ impl ToStr for ProgramError {
283283
}
284284
}
285285
}
286+
287+
#[cfg(feature = "std")]
288+
impl core::fmt::Display for ProgramError {
289+
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
290+
write!(f, "{:?}", self)
291+
}
292+
}
293+
294+
// TODO: Replace with core import when we bump rust version
295+
#[cfg(feature = "std")]
296+
impl std::error::Error for ProgramError {}

0 commit comments

Comments
 (0)