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

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

Issue 24877002: Add more informative messages for DOM exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Upload again 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
« no previous file with comments | « Source/modules/webaudio/AudioNode.cpp ('k') | Source/modules/webaudio/DelayNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/DefaultAudioDestinationNode.cpp
diff --git a/Source/modules/webaudio/DefaultAudioDestinationNode.cpp b/Source/modules/webaudio/DefaultAudioDestinationNode.cpp
index 1d013d9d9c869e73c3a2d97ab994bffea91b1bce..cf138c844ab083792617f648a4acd20f217bb71d 100644
--- a/Source/modules/webaudio/DefaultAudioDestinationNode.cpp
+++ b/Source/modules/webaudio/DefaultAudioDestinationNode.cpp
@@ -28,6 +28,7 @@
#include "modules/webaudio/DefaultAudioDestinationNode.h"
+#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
#include "core/platform/Logging.h"
@@ -119,7 +120,14 @@ void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex
ASSERT(isMainThread());
if (!maxChannelCount() || channelCount > maxChannelCount()) {
- es.throwUninformativeAndGenericDOMException(InvalidStateError);
+ es.throwDOMException(
+ InvalidStateError,
+ ExceptionMessages::failedToSet(
+ "channelCount",
+ "AudioDestinationNode",
+ "channel count (" + String::number(channelCount)
+ + ") must be between 1 and "
+ + String::number(maxChannelCount()) + "."));
return;
}
« no previous file with comments | « Source/modules/webaudio/AudioNode.cpp ('k') | Source/modules/webaudio/DelayNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698