aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/event_dispatcher/script_execution_exception.rs
blob: e4ce1ec02a09c996d1421487137a3377c4d56d69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//! ref: composer/src/Composer/EventDispatcher/ScriptExecutionException.php

use shirabe_php_shim::RuntimeException;

/// Thrown when a script running an external process exits with a non-0 status code
#[derive(Debug)]
pub struct ScriptExecutionException(pub RuntimeException);

impl ScriptExecutionException {
    pub fn new(message: String, code: i64) -> Self {
        Self(RuntimeException::with_code(message, code))
    }
}

shirabe_php_shim::impl_php_exception!(
    ScriptExecutionException,
    0,
    r"Composer\EventDispatcher\ScriptExecutionException"
);