#include "third_party/blink/renderer/modules/ai/exception_helpers.h"
#include "base/debug/dump_without_crashing.h"
#include "base/notreached.h"
#include "third_party/blink/public/mojom/ai/ai_manager.mojom-shared.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.h"
namespace blink {
const char kExceptionMessageExecutionContextInvalid[] = …;
const char kExceptionMessageServiceUnavailable[] = …;
const char kExceptionMessagePermissionDenied[] = …;
const char kExceptionMessageGenericError[] = …;
const char kExceptionMessageFiltered[] = …;
const char kExceptionMessageDisabled[] = …;
const char kExceptionMessageCancelled[] = …;
const char kExceptionMessageSessionDestroyed[] = …;
const char kExceptionMessageInvalidTemperatureAndTopKFormat[] = …;
const char kExceptionMessageUnableToCreateSession[] = …;
const char kExceptionMessageUnableToCloneSession[] = …;
const char kExceptionMessageRequestAborted[] = …;
void ThrowInvalidContextException(ExceptionState& exception_state) { … }
void ThrowSessionDestroyedException(ExceptionState& exception_state) { … }
void RejectPromiseWithInternalError(ScriptPromiseResolverBase* resolver) { … }
DOMException* CreateInternalErrorException() { … }
namespace {
DOMException* CreateUnknown(const char* error) { … }
}
DOMException* ConvertModelStreamingResponseErrorToDOMException(
ModelStreamingResponseStatus error) { … }
WTF::String ConvertModelAvailabilityCheckResultToDebugString(
mojom::blink::ModelAvailabilityCheckResult result) { … }
}