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

Unified Diff: Source/modules/webaudio/AudioBuffer.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/AudioBuffer.cpp
diff --git a/Source/modules/webaudio/AudioBuffer.cpp b/Source/modules/webaudio/AudioBuffer.cpp
index e41ba22063db137dd7ad7ee09439bec5b09c7465..ab9b5541c9a45beb51284a93e416d4c230591eee 100644
--- a/Source/modules/webaudio/AudioBuffer.cpp
+++ b/Source/modules/webaudio/AudioBuffer.cpp
@@ -32,6 +32,7 @@
#include "modules/webaudio/AudioBuffer.h"
+#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
#include "core/platform/audio/AudioBus.h"
@@ -97,7 +98,12 @@ void AudioBuffer::releaseMemory()
PassRefPtr<Float32Array> AudioBuffer::getChannelData(unsigned channelIndex, ExceptionState& es)
{
if (channelIndex >= m_channels.size()) {
- es.throwUninformativeAndGenericDOMException(SyntaxError);
+ es.throwDOMException(
+ SyntaxError,
+ ExceptionMessages::failedToGet(
+ "getChannelData",
Mike West 2013/09/27 06:44:39 If this is called as `ab.getChannelData()`, then I
+ "AudioBuffer",
+ "invalid channel index."));
Mike West 2013/09/27 06:44:39 How about "The provided index (" + String::number(
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698