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

Unified Diff: sync/api/sync_error.h

Issue 388003002: Sync: Display non-severe errors on about:sync in gray color rather than red. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed failing unit test, added extra test case, addressed CR feedback. Created 6 years, 5 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 | « components/sync_driver/failed_data_types_handler.cc ('k') | sync/api/sync_error.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/sync_error.h
diff --git a/sync/api/sync_error.h b/sync/api/sync_error.h
index f6ffa87f3132c8c795bb60aeb00e6e81542c26b0..281621e55b7adba45484517739c6cd333b54ed63 100644
--- a/sync/api/sync_error.h
+++ b/sync/api/sync_error.h
@@ -38,8 +38,18 @@ class SYNC_EXPORT SyncError {
// datataype should be associated after a sync update.
CRYPTO_ERROR, // A cryptographer error was detected, and the
// datatype should be associated after it is resolved.
- UNREADY_ERROR, // The type is not ready to start yet, so should be
+ UNREADY_ERROR, // A datatype is not ready to start yet, so should be
// neither purged nor enabled until it is ready.
+ DATATYPE_POLICY_ERROR // A datatype should be disabled and purged due
+ // to configuration constraints.
+ };
+
+ // Severity is used to indicate how an error should be logged and
+ // represented to an end user.
+ enum Severity {
+ SYNC_ERROR_SEVERITY_ERROR, // Severe unrecoverable error.
+ SYNC_ERROR_SEVERITY_INFO // Low-severity recoverable error or
+ // configuration policy issue.
};
// Default constructor refers to "no error", and IsSet() will return false.
@@ -76,6 +86,11 @@ class SYNC_EXPORT SyncError {
ModelType model_type() const;
ErrorType error_type() const;
+ // Error severity for logging and UI purposes.
+ Severity GetSeverity() const;
+ // Type specific message prefix for logging and UI purposes.
+ std::string GetMessagePrefix() const;
+
// Returns empty string is IsSet() is false.
std::string ToString() const;
private:
« no previous file with comments | « components/sync_driver/failed_data_types_handler.cc ('k') | sync/api/sync_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698