1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use region;
use mmap;
error_chain! {
    foreign_links {
        RegionFailure(region::error::Error);
        AllocateFailure(mmap::MapError);
    }
    errors {
        
        AlreadyExisting { display("detour has already been initialized") }
        
        InvalidCode { display("address contains invalid assembly") }
        
        NoPatchArea { display("cannot find an inline patch area") }
        
        NotExecutable { display("address is not executable") }
        
        OutOfMemory { display("cannot allocate memory") }
        
        UnsupportedLoop { display("address contains an unsupported loop") }
        
        UnsupportedRelativeBranch { display("address contains an unsupported branch") }
    }
}