Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2125)

Unified Diff: Source/modules/webaudio/OfflineAudioContext.cpp

Issue 24877002: Add more informative messages for DOM exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/webaudio/OfflineAudioContext.cpp
diff --git a/Source/modules/webaudio/OfflineAudioContext.cpp b/Source/modules/webaudio/OfflineAudioContext.cpp
index adfe8ce72288dd06ca08f25b8b6bf35b3e839813..4f90e7b595eb55656fc03e6ec26cd34914f98d68 100644
--- a/Source/modules/webaudio/OfflineAudioContext.cpp
+++ b/Source/modules/webaudio/OfflineAudioContext.cpp
@@ -28,6 +28,7 @@
#include "modules/webaudio/OfflineAudioContext.h"
+#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
@@ -39,14 +40,20 @@ PassRefPtr<OfflineAudioContext> OfflineAudioContext::create(ScriptExecutionConte
{
// FIXME: add support for workers.
if (!context || !context->isDocument()) {
- es.throwUninformativeAndGenericDOMException(NotSupportedError);
+ es.throwDOMException(
+ NotSupportedError,
+ ExceptionMessages::failedToConstruct("OfflineAudioContext"));
return 0;
}
Document* document = toDocument(context);
if (numberOfChannels > 10 || !isSampleRateRangeGood(sampleRate)) {
- es.throwUninformativeAndGenericDOMException(SyntaxError);
+ es.throwDOMException(
+ SyntaxError,
+ ExceptionMessages::failedToConstruct(
+ "OfflineAudioContext",
+ "invalid number of channels or sample rate"));
Mike West 2013/09/27 06:44:39 Same as above.
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698