jbcrs_basic/result.rs
1use std::{io, result};
2
3#[derive(Debug, YadeError)]
4pub enum Error {
5 /// Just an I/O error
6 IO(#[cause] io::Error),
7
8 /// A modified utf-8 string could not be read
9 InvalidUTF8,
10
11 /// Decoder has come to the end of the file or the limit was exceeded
12 LimitExceeded,
13
14 /// Not a class file, the header does not equal 0xCAFEBABE
15 NotAClass,
16
17 /// Invalid constant pool entry
18 InvalidCPItem(u16),
19
20 /// The constant pool cannot be larger than `u16::max_value()`
21 CPTooLarge,
22
23 /// Invalid instruction, (e.g. unknown op code)
24 InvalidInstruction { op_code: u8, at: u32 },
25
26 /// Reserved (invalid) stack map frame
27 ReservedStackMapFrame(u8),
28
29 /// Invalid verification type in stack map table
30 InvalidVerificationType(u8),
31
32 /// Invalid element value of annotation, where the u8 is the tag
33 InvalidElementValue(u8),
34
35 /// Invalid target type of annotation
36 InvalidTargetType,
37
38 /// Invalid type path element kind of annotation
39 InvalidTypePath,
40}
41
42pub type Result<T> = result::Result<T, Error>;