diff --git a/src/common/getters.ts b/src/common/getters.ts index 7c9d84d1..416b78d7 100644 --- a/src/common/getters.ts +++ b/src/common/getters.ts @@ -465,7 +465,7 @@ function deserializeFields( if (result === undefined) { // FIXME use inrupt error library throw new Error( - `Error deserializing value ${object} for predicate ${field.href} as type ${type}.`, + `Failed to deserialize value ${object.value} for predicate ${field.href} as type ${type}.`, ); } return result; diff --git a/src/type/CustomField.ts b/src/type/CustomField.ts index 058e95f8..970e1e6f 100644 --- a/src/type/CustomField.ts +++ b/src/type/CustomField.ts @@ -71,7 +71,7 @@ export const toJson = ( if (!["string", "number", "boolean"].includes(typeof field.value)) { // FIXME use inrupt error library throw new Error( - `All custom fields values must be literals, found ${field.value} (or type ${typeof field.value})`, + `All custom fields values must be literals, found ${JSON.stringify(field.value)} (of type ${typeof field.value})`, ); } return { [`${field.key.toString()}`]: field.value };