Home
last modified time | relevance | path

Searched refs:CustomError (Results 1 – 9 of 9) sorted by relevance

/third_party/rust/crates/nom/tests/
Dcustom_errors.rs13 pub struct CustomError(String); struct
15 impl<'a> From<(&'a str, ErrorKind)> for CustomError { implementation
17 CustomError(format!("error code was: {:?}", error)) in from()
21 impl<'a> ParseError<&'a str> for CustomError { implementation
23 CustomError(format!("error code was: {:?}", kind)) in from_error_kind()
26 fn append(_: &'a str, kind: ErrorKind, other: CustomError) -> Self { in append()
27 CustomError(format!("{:?}\nerror code was: {:?}", other, kind)) in append()
31 fn test1(input: &str) -> IResult<&str, &str, CustomError> { in test1() argument
36 fn test2(input: &str) -> IResult<&str, &str, CustomError> { in test2() argument
41 fn test3(input: &str) -> IResult<&str, &str, CustomError> { in test3() argument
[all …]
/third_party/rust/crates/nom/examples/
Dcustom_error.rs9 pub enum CustomError<I> { enum
14 impl<I> ParseError<I> for CustomError<I> { implementation
16 CustomError::Nom(input, kind) in from_error_kind()
24 pub fn parse(_input: &str) -> IResult<&str, &str, CustomError<&str>> { in parse()
25 Err(Error(CustomError::MyError)) in parse()
33 use super::CustomError;
40 Error(e) => assert_eq!(e, CustomError::MyError), in it_works()
/third_party/rust/crates/nom/src/combinator/
Dtests.rs93 impl From<u32> for CustomError { implementation
95 CustomError in from()
99 impl<I> ParseError<I> for CustomError { implementation
101 CustomError in from_error_kind()
104 fn append(_: I, _: ErrorKind, _: CustomError) -> Self { in append()
105 CustomError in append()
109 struct CustomError; struct
111 fn custom_error(input: &[u8]) -> IResult<&[u8], &[u8], CustomError> { in custom_error() argument
/third_party/typescript/tests/arkTSTest/testcase/arkts-limited-throw/
Darkts-limited-throw-2-ok.ets19 class CustomError extends Error {
22 this.name = "CustomError";
26 throw new CustomError("Custom error information")
Darkts-limited-throw-3-ok.ets19 class CustomError extends Error {
22 this.name = 'CustomError'
27 throw new CustomError(500, 'Server error')
/third_party/node/deps/npm/node_modules/err-code/test/
Dtest.js109 class CustomError extends Error { class
115 const myErr = new CustomError('my message');
124 expect(err).to.be.a(CustomError);
130 const otherErr = new CustomError('my message');
/third_party/node/test/parallel/
Dtest-util-format.js452 class CustomError extends Error { class
459 Error.captureStackTrace(this, CustomError);
462 const customError = new CustomError('bar');
/third_party/python/Lib/test/
Dtest_dataclasses.py23 class CustomError(Exception): pass class
889 raise CustomError()
890 with self.assertRaises(CustomError):
898 raise CustomError()
899 with self.assertRaises(CustomError):
909 raise CustomError()
935 raise CustomError()
950 with self.assertRaises(CustomError):
959 with self.assertRaises(CustomError):
3859 raise CustomError(f'{b=} {d=}')
[all …]
/third_party/python/Doc/library/
Ddoctest.rst581 >>> raise CustomError('message')
583 CustomError: message
585 >>> raise CustomError('message')
587 my_module.CustomError: message