Lines Matching refs:thrown
76 // assertThrown can be used to assert that an exception is thrown
79 // ifThrown can be used to provide a default value if an exception is thrown
118 of `Throwable`. If a `Throwable` of the given type is thrown,
120 `AssertError` is thrown. However, any other `Throwable`s will escape.
126 If msg is empty, and the thrown exception has a
135 `AssertError` if the given `Throwable` is thrown.
155 throw new AssertError("assertNotThrown failed: " ~ T.stringof ~ " was thrown" ~ tail, file, line, t);
171 `assertNotThrown failed: StringException was thrown: Error!`);
179 `assertNotThrown failed: StringException was thrown: Error!`);
183 `assertNotThrown failed: StringException was thrown.`);
187 `assertNotThrown failed: StringException was thrown.`);
222 bool thrown = false;
228 catch (AssertError) thrown = true;
229 assert(thrown);
233 bool thrown = false;
239 catch (AssertError) thrown = true;
240 assert(thrown);
244 bool thrown = false;
250 catch (AssertError) thrown = true;
251 assert(thrown);
255 bool thrown = false;
262 catch (AssertError) thrown = true;
263 assert(thrown);
271 of the given type is thrown, then an `AssertError` is thrown.
283 `AssertError` if the given `Throwable` is not thrown.
299 throw new AssertError("assertThrown failed: No " ~ T.stringof ~ " was thrown"
316 `assertThrown failed: No StringException was thrown.`);
356 bool thrown = false;
360 thrown = true;
362 assert(thrown);
366 bool thrown = false;
370 thrown = true;
372 assert(thrown);
376 bool thrown = false;
380 thrown = true;
382 assert(thrown);
386 bool thrown = false;
390 thrown = true;
392 assert(thrown);
399 If the given value is false, an exception is thrown.
404 $(LI `ex` - custom exception to be thrown. It is `lazy` and is only created if an exception occurred)
410 msg = The error message to put in the exception if it is thrown.
417 depending on the chosen overload, `new Exception(msg)`, `dg()` or `ex` is thrown.
483 assertNotThrown(enforce(true, new Exception("this should not be thrown")));
484 assertThrown(enforce(false, new Exception("this should be thrown")));
621 msg = The message to include in the `ErrnoException` if it is thrown.
624 $(D new ErrnoException(msg)) is thrown. It is assumed that the last
645 Catches and returns the exception thrown from the given expression.
646 If no exception is thrown, then null is returned and `result` is
659 result = The result of the expression if no exception is thrown.
693 Catches and returns the exception thrown from the given expression.
694 If no exception is thrown, then null is returned. `E` can be
731 Catches the exception thrown from the given expression and returns the
732 msg property of that exception. If no exception is thrown, then null is
735 If an exception is thrown but it has an empty message, then
955 * subclass `Exception` may be thrown even from `nothrow` functions,
1639 * Thrown if errors that set `errno` occur.
1807 /// Use a lambda to get the thrown object.
1843 //Use a lambda to get the thrown object.
1951 /** Handle exceptions thrown from range primitives.
1965 return value whenever `E` is thrown. For `opIndex`, the handler can
2251 throw new Exception("empty has thrown");
2256 throw new Exception("front has thrown");
2261 throw new Exception("back has thrown");
2266 throw new Exception("popFront has thrown");
2271 throw new Exception("popBack has thrown");
2276 throw new Exception("opIndex has thrown");
2281 throw new Exception("opSlice has thrown");
2286 throw new Exception("length has thrown");
2293 throw new Exception("save has thrown");
2369 throw new Exception("opSlice has thrown");
2391 the exception was thrown from; 2$(RPAREN) be usable with $(LREF enforce) which