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

Side by Side Diff: components/sync/model/model_error.h

Issue 2618483003: [Sync] Introduce ModelError for USS error handling. (Closed)
Patch Set: Address comments. Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « components/sync/model/mock_model_type_store.cc ('k') | components/sync/model/model_error.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_SYNC_MODEL_MODEL_ERROR_H_
6 #define COMPONENTS_SYNC_MODEL_MODEL_ERROR_H_
7
8 #include <string>
9
10 #include "base/location.h"
11
12 namespace syncer {
13
14 // A minimal error object for use by USS model type code.
15 class ModelError {
16 public:
17 // Creates an un-set error object (indicating an operation was successful).
18 ModelError();
19
20 // Creates a set error object with the given location and message.
21 ModelError(const tracked_objects::Location& location,
22 const std::string& message);
23
24 ~ModelError();
25
26 // Whether this object represents an actual error.
27 bool IsSet() const;
28
29 // The location of the error this object represents. Can only be called if the
30 // error is set.
31 const tracked_objects::Location& location() const;
32
33 // The message explaining the error this object represents. Can only be called
34 // if the error is set.
35 const std::string& message() const;
36
37 private:
38 bool is_set_;
39 tracked_objects::Location location_;
40 std::string message_;
41 };
42
43 } // namespace syncer
44
45 #endif // COMPONENTS_SYNC_MODEL_MODEL_ERROR_H_
OLDNEW
« no previous file with comments | « components/sync/model/mock_model_type_store.cc ('k') | components/sync/model/model_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698