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

Unified Diff: webrtc/api/peerconnectioninterface.h

Issue 2564683002: Adding error enum to be used by PeerConnectionInterface methods. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnectioninterface.h
diff --git a/webrtc/api/peerconnectioninterface.h b/webrtc/api/peerconnectioninterface.h
index 54fae2b71107398b6938e1b4c2797c00044ce4c8..cd58ae445570fb8034c1731dc0502fab7eaba545 100644
--- a/webrtc/api/peerconnectioninterface.h
+++ b/webrtc/api/peerconnectioninterface.h
@@ -140,6 +140,38 @@ class MetricsObserverInterface : public rtc::RefCountInterface {
typedef MetricsObserverInterface UMAObserver;
+// Enumeration to represent distinct classes of errors that an application
+// may wish to act upon differently. These roughly map to DOMExceptions in
+// the web API, as described in the comments below.
+enum class RtcError {
hta-webrtc 2016/12/09 10:13:16 Almost every time I've had an error enum, there's
Taylor Brandstetter 2016/12/09 18:39:07 Ah yes, we do need that. Would have realized the f
+ // A supplied parameter is valid, but currently unsupported.
+ // Maps to InvalidAccessError DOMException.
+ UNSUPPORTED_PARAMETER,
hta-webrtc 2016/12/09 10:13:16 Why the ALL_CAPS_YELLING_NAMES? https://google.gi
Taylor Brandstetter 2016/12/09 18:39:07 The Chromium guide says to use this style, and I t
pthatcher1 2016/12/10 02:14:44 Yeah, we just had that discussion back in June.
+ // General error indicating that a supplied parameter is invalid.
+ // Maps to InvalidAccessError or TypeError DOMException depending on context.
+ INVALID_PARAMETER,
+ // Slightly more specific than INVALID_PARAMETER; a parameter's value was
+ // outside the allowed range.
+ // Maps to RangeError DOMException.
+ INVALID_RANGE,
+ // Slightly more specific than INVALID_PARAMETER; an error occurred while
+ // parsing string input.
+ // Maps to SyntaxError DOMException.
+ SYNTAX_ERROR,
+ // The object does not support this operation in its current state.
+ // Maps to InvalidStateError DOMException.
+ INVALID_STATE,
+ // An attempt was made to modify the object in an invalid way.
+ // Maps to InvalidModificationError DOMException.
+ INVALID_MODIFICATION,
+ // An error occurred within an underlying network protocol.
+ // Maps to NetworkError DOMException.
+ NETWORK_ERROR,
+ // The operation failed due to an internal error.
+ // Maps to OperationError DOMException.
+ INTERNAL_ERROR,
+};
+
hta-webrtc 2016/12/09 10:13:16 I've found it wise to add an ostream& operator<< (
Taylor Brandstetter 2016/12/09 18:39:07 Done.
class PeerConnectionInterface : public rtc::RefCountInterface {
public:
// See http://dev.w3.org/2011/webrtc/editor/webrtc.html#state-definitions .
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698