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

Side by Side Diff: extensions/renderer/api_invocation_errors.cc

Issue 2847853002: [Extensions Bindings] Add errors to signature parsing (Closed)
Patch Set: Rebase Created 3 years, 7 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/renderer/api_invocation_errors.h" 5 #include "extensions/renderer/api_invocation_errors.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 std::string UnserializableValue() { 82 std::string UnserializableValue() {
83 return "Value is unserializable."; 83 return "Value is unserializable.";
84 } 84 }
85 85
86 std::string ScriptThrewError() { 86 std::string ScriptThrewError() {
87 return "Script threw an error."; 87 return "Script threw an error.";
88 } 88 }
89 89
90 std::string TooManyArguments() {
91 return "Too many arguments.";
92 }
93
94 std::string MissingRequiredArgument(const char* argument_name) {
95 return base::StringPrintf("Missing required argument '%s'.", argument_name);
96 }
97
90 std::string IndexError(uint32_t index, const std::string& error) { 98 std::string IndexError(uint32_t index, const std::string& error) {
91 return base::StringPrintf("Error at index %u: %s", index, error.c_str()); 99 return base::StringPrintf("Error at index %u: %s", index, error.c_str());
92 } 100 }
93 101
94 std::string PropertyError(const char* property_name, const std::string& error) { 102 std::string PropertyError(const char* property_name, const std::string& error) {
95 return base::StringPrintf("Error at property '%s': %s", property_name, 103 return base::StringPrintf("Error at property '%s': %s", property_name,
96 error.c_str()); 104 error.c_str());
97 } 105 }
98 106
107 std::string ArgumentError(const std::string& parameter_name,
108 const std::string& error) {
109 return base::StringPrintf("Error at parameter '%s': %s",
110 parameter_name.c_str(), error.c_str());
111 }
112
99 } // namespace api_errors 113 } // namespace api_errors
100 } // namespace extensions 114 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api_invocation_errors.h ('k') | extensions/renderer/api_invocation_errors_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698