Skip to content

Use the htmlName in error messages #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions extensions/dbgobject/arrays/arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Loader.OnLoad(function() {

ArrayField.prototype.ensureCompatibleResult = function(result, parentDbgObject) {
if (!Array.isArray(result)) {
throw new Error("The \"" + this.name + "\" array on " + parentDbgObject.type.name() + " did not return an array.");
throw new Error("The \"" + this.name + "\" array on " + parentDbgObject.type.htmlName() + " did not return an array.");
}

var that = this;
Expand All @@ -36,7 +36,7 @@ Loader.OnLoad(function() {
.then(function (areAllTypes) {
var incorrectIndex = areAllTypes.indexOf(false);
if (incorrectIndex != -1) {
throw new Error("The \"" + that.name + "\" array on " + parentDbgObject.type.name() + " was supposed to return an array of " + resultType + " but there was an unrelated " + result[incorrectIndex].type.name() + ".")
throw new Error("The \"" + that.name + "\" array on " + parentDbgObject.type.htmlName() + " was supposed to return an array of " + resultType + " but there was an unrelated " + result[incorrectIndex].type.htmlName() + ".")
}

return result;
Expand Down Expand Up @@ -95,7 +95,7 @@ Loader.OnLoad(function() {
return registeredArrayTypes.getExtensionIncludingBaseTypes(this, name)
.then(function (result) {
if (result == null) {
throw new Error("There was no array \"" + name + "\" on " + that.type.name());
throw new Error("There was no array \"" + name + "\" on " + that.type.htmlName());
}
return Promise.resolve(result.extension.getter(result.dbgObject))
.then(function (resultArray) {
Expand Down