{"record":{"id":"37e7e5db510f6e28","repo":"pestphp/pest","slug":"exception-exception-not-thrown","errorCode":null,"errorMessage":"Exception [$exception] not thrown.","messagePattern":"Exception \\[\\$exception\\] not thrown\\.","errorType":"exception","errorClass":"ExpectationFailedException","httpStatus":null,"severity":"error","filePath":"src/Mixins/Expectation.php","lineNumber":875,"sourceCode":"\n            if ($exceptionMessage !== null) {\n                Assert::assertStringContainsString($exceptionMessage, $e->getMessage(), $message);\n            }\n\n            Assert::assertInstanceOf($exception, $e, $message);\n\n            $callback($e);\n\n            return $this;\n        }\n\n        Assert::assertTrue(true);\n\n        if (! $exception instanceof Throwable && ! class_exists($exception)) {\n            throw new ExpectationFailedException(\"Exception with message [$exception] not thrown.\");\n        }\n\n        throw new ExpectationFailedException(\"Exception [$exception] not thrown.\");\n    }\n\n    private function export(mixed $value): string\n    {\n        if (! $this->exporter instanceof Exporter) {\n            $this->exporter = Exporter::default();\n        }\n\n        return $this->exporter->shortenedExport($value);\n    }\n\n    /**\n     * @return self<TValue>\n     */\n    public function toBeUppercase(string $message = ''): self\n    {\n        Assert::assertTrue(ctype_upper((string) $this->value), $message);\n","sourceCodeStart":857,"sourceCodeEnd":893,"githubUrl":"https://github.com/pestphp/pest/blob/1af74a215c3a89bc7a44fc6f9322e369eaad2423/src/Mixins/Expectation.php#L857-L893","documentation":"Error \"Exception [$exception] not thrown.\" thrown in pestphp/pest.","triggerScenarios":"Thrown at src/Mixins/Expectation.php:875 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1af74a215c3a89bc7a44fc6f9322e369eaad2423","analyzedAt":"2026-08-21T02:16:38.132Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}