aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/dependency_resolver/solver_bug_exception.rs
blob: 5234108f6cef27926cced22bc7dcbad164a77528 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! ref: composer/src/Composer/DependencyResolver/SolverBugException.php

use shirabe_php_shim::RuntimeException;

#[derive(Debug)]
pub struct SolverBugException(pub RuntimeException);

impl SolverBugException {
    pub fn new(message: String) -> Self {
        let full_message = format!(
            "{}\nThis exception was most likely caused by a bug in Composer.\n\
            Please report the command you ran, the exact error you received, and your composer.json on https://github.com/nsfisis/php-shirabe/issues - thank you!\n",
            message
        );
        SolverBugException(RuntimeException::new(full_message))
    }
}

shirabe_php_shim::impl_php_exception!(
    SolverBugException,
    0,
    r"Composer\DependencyResolver\SolverBugException"
);