rust/hg-cpython/src/exceptions.rs
changeset 50975 3aca98a35727
parent 48519 35ebe6f824be
child 50979 4c5f6e95df84
equal deleted inserted replaced
50974:c950fdba7472 50975:3aca98a35727
    23 impl GraphError {
    23 impl GraphError {
    24     pub fn pynew(py: Python, inner: hg::GraphError) -> PyErr {
    24     pub fn pynew(py: Python, inner: hg::GraphError) -> PyErr {
    25         match inner {
    25         match inner {
    26             hg::GraphError::ParentOutOfRange(r) => {
    26             hg::GraphError::ParentOutOfRange(r) => {
    27                 GraphError::new(py, ("ParentOutOfRange", r))
    27                 GraphError::new(py, ("ParentOutOfRange", r))
    28             }
       
    29             hg::GraphError::WorkingDirectoryUnsupported => {
       
    30                 match py
       
    31                     .import("mercurial.error")
       
    32                     .and_then(|m| m.get(py, "WdirUnsupported"))
       
    33                 {
       
    34                     Err(e) => e,
       
    35                     Ok(cls) => PyErr::from_instance(py, cls),
       
    36                 }
       
    37             }
    28             }
    38         }
    29         }
    39     }
    30     }
    40 
    31 
    41     pub fn pynew_from_vcsgraph(
    32     pub fn pynew_from_vcsgraph(