async def METHOD_NAME(self, compile: data.Compile) -> None:
    if not compile.success:
        compile_report = await data.Compile.get_report(compile_id=compile.id)
        reports = compile_report["reports"] if compile_report else []
        failed_pull_stage = next(
            (report for report in reports if report["name"] == "Pulling updates" and report["returncode"] != 0), None
        )
        if compile.notify_failed_compile is False:
            return
        elif compile.notify_failed_compile and compile.failed_compile_message:
            # Use specific message provided in request
            await self.notify(
                compile.environment,
                title="Compilation failed",
                message=compile.failed_compile_message,
                severity=const.NotificationSeverity.error,
                uri=f"/api/v2/compilereport/{compile.id}",
            )
        elif failed_pull_stage:
            await self.notify(
                compile.environment,
                title="Pulling updates during compile failed",
                message=failed_pull_stage["errstream"],
                severity=const.NotificationSeverity.error,
                uri=f"/api/v2/compilereport/{compile.id}",
            )
        elif compile.do_export:
            await self.notify(
                compile.environment,
                title="Compilation failed",
                message="An exporting compile has failed",
                severity=const.NotificationSeverity.error,
                uri=f"/api/v2/compilereport/{compile.id}",
            )
        elif compile.notify_failed_compile:
            # Send notification with generic message as fallback
            await self.notify(
                compile.environment,
                title="Compilation failed",
                message="A compile has failed",
                severity=const.NotificationSeverity.error,
                uri=f"/api/v2/compilereport/{compile.id}",
            )