Skip to content

Commit 0a51eb1

Browse files
author
Perki
committed
Fixing error
1 parent d2a4a7f commit 0a51eb1

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

components/pryv/src/Connection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ class Connection {
111111
result[0].error ||
112112
(expectedKey != null && result[0][expectedKey] == null)
113113
) {
114-
const innerError = result[0]?.error || result;
114+
const innerObject = result[0]?.error || result;
115115
throw new PryvError(
116116
`Error for api method: "${method}" with params: ${JSON.stringify(
117117
params
118-
)} >> Result: ${JSON.stringify(innerError)}"`,
119-
innerError
118+
)} >> Result: ${JSON.stringify(innerObject)}"`,
119+
innerObject
120120
);
121121
}
122122
if (expectedKey != null) return result[0][expectedKey];

components/pryv/src/globals.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ declare global {
6767
* Custom error class for Pryv library errors
6868
*/
6969
class PryvError extends Error {
70-
constructor(message: string, innerError?: Error | object);
70+
constructor(message: string, innerObject?: Error | object);
7171
name: 'PryvError';
72-
innerError?: Error | object;
72+
innerObject?: Error | object;
7373
}
7474
}
7575

components/pryv/src/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ declare module 'pryv' {
166166

167167
/**
168168
* Custom error class for Pryv library errors.
169-
* Includes an innerError property for wrapping underlying errors.
169+
* Includes an innerObject property for wrapping underlying errors.
170170
*/
171171
export class PryvError extends globalThis.Error {
172-
constructor(message: string, innerError?: globalThis.Error | object);
172+
constructor(message: string, innerObject?: globalThis.Error | object);
173173
name: 'PryvError';
174-
innerError?: globalThis.Error | object;
174+
innerObject?: globalThis.Error | object;
175175
}
176176

177177
export type StreamsQuery = {

components/pryv/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @property {pryv.Connection} Connection - To interact with an individual's (user) data set
1010
* @property {pryv.Browser} Browser - Browser Tools - Access request helpers and visuals (button)
1111
* @property {pryv.utils} utils - Exposes some utils for HTTP calls and tools to manipulate Pryv's API endpoints
12-
* @property {pryv.PryvError} PryvError - Custom error class with innerError support
12+
* @property {pryv.PryvError} PryvError - Custom error class with innerObject support
1313
*/
1414
module.exports = {
1515
Service: require('./Service'),

components/pryv/src/lib/PryvError.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55

66
/**
77
* Custom error class for Pryv library errors.
8-
* Includes an innerError property for wrapping underlying errors.
8+
* Includes an innerObject property for wrapping underlying errors.
99
* @extends Error
1010
*/
1111
class PryvError extends Error {
1212
/**
1313
* Create a PryvError
1414
* @param {string} message - Error message
15-
* @param {Error|Object} [innerError] - The underlying error or object that caused this error
15+
* @param {Error|Object} [innerObject] - The underlying error or object that caused this error
1616
*/
17-
constructor (message, innerError) {
17+
constructor (message, innerObject) {
1818
super(message);
1919
this.name = 'PryvError';
2020
/** @type {Error|Object|undefined} */
21-
this.innerError = innerError;
21+
this.innerObject = innerObject;
2222

2323
// Maintains proper stack trace for where error was thrown (only in V8)
2424
if (Error.captureStackTrace) {

0 commit comments

Comments
 (0)