RsBundle  Diff

Differences From Artifact [a87cba77d7]:

  • File src/solver/sync.rs — part of check-in [423a236c32] at 2019-11-18 07:39:17 on branch trunk — sync: automatic error conversion for `RecvError` (user: fifr size: 30048)

To Artifact [82f26c9021]:

  • File src/solver/sync.rs — part of check-in [0f483ac01e] at 2019-11-18 07:40:08 on branch trunk — sync: `Error::Process` is now a wrapper for `RecvError` (user: fifr size: 30022)

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    /// Invalid bounds for a variable.
    InvalidBounds { lower: Real, upper: Real },
    /// The value of a variable is outside its bounds.
    ViolatedBounds { lower: Real, upper: Real, value: Real },
    /// The variable index is out of bounds.
    InvalidVariable { index: usize, nvars: usize },
    /// An error occurred in a subprocess.
    Process(Box<dyn std::error::Error>),
    /// A method requiring an initialized solver has been called.
    NotInitialized,
    /// The problem has not been solved yet.
    NotSolved,
}

impl<E> std::fmt::Display for Error<E>







|







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    /// Invalid bounds for a variable.
    InvalidBounds { lower: Real, upper: Real },
    /// The value of a variable is outside its bounds.
    ViolatedBounds { lower: Real, upper: Real, value: Real },
    /// The variable index is out of bounds.
    InvalidVariable { index: usize, nvars: usize },
    /// An error occurred in a subprocess.
    Process(RecvError),
    /// A method requiring an initialized solver has been called.
    NotInitialized,
    /// The problem has not been solved yet.
    NotSolved,
}

impl<E> std::fmt::Display for Error<E>
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
        use Error::*;
        match self {
            BuildMaster(err) => Some(err.as_ref()),
            Master(err) => Some(err.as_ref()),
            Evaluation(err) => Some(err),
            Process(err) => Some(err.as_ref()),
            _ => None,
        }
    }
}

impl<E, MErr> From<masterprocess::Error<MErr>> for Error<E>
where







|







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
        use Error::*;
        match self {
            BuildMaster(err) => Some(err.as_ref()),
            Master(err) => Some(err.as_ref()),
            Evaluation(err) => Some(err),
            Process(err) => Some(err),
            _ => None,
        }
    }
}

impl<E, MErr> From<masterprocess::Error<MErr>> for Error<E>
where