Skip to content

Commit 7b478a3

Browse files
SCAL-256912 updated the error message type
1 parent 178f408 commit 7b478a3

File tree

3 files changed

+4710
-3621
lines changed

3 files changed

+4710
-3621
lines changed

src/embed/ts-embed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export class TsEmbed {
450450
...(this.embedConfig.customActions || [])
451451
]);
452452
if (customActionsResult.errors.length > 0) {
453-
this.handleError({ type: 'CUSTOM_ACTION_VALIDATION', message: customActionsResult.errors }, { errorType: 'VALIDATION_ERROR', message: customActionsResult.errors, code: 'CUSTOM_ACTION_VALIDATION', source: 'SDK', details: {} } as EmbedErrorDetailsEvent);
453+
this.handleError({ type: ERROR_CODE.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }, { errorType: 'VALIDATION_ERROR', message: customActionsResult.errors, code: ERROR_CODE.CUSTOM_ACTION_VALIDATION, source: 'SDK', details: {} } as EmbedErrorDetailsEvent);
454454
}
455455
const baseInitData = {
456456
customisations: getCustomisations(this.embedConfig, this.viewConfig),

src/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,7 +2060,7 @@ export enum EmbedEvent {
20602060
*
20612061
* For more information, see https://developers.thoughtspot.com/docs/events-app-integration#errorType
20622062
* @returns error - An error object {@link EmbedErrorDetailsEvent}
2063-
* @version SDK: 1.44.0 | ThoughtSpot: 10.16.0.cl
2063+
* @version SDK: 1.44.0 | ThoughtSpot: 26.2.0.cl
20642064
* @example
20652065
* ```js
20662066
* // API error
@@ -6133,21 +6133,21 @@ export enum LogLevel {
61336133
*
61346134
* @param errorType - The type of error that occurred.
61356135
* @param message - A human-readable error message describing what went wrong.
6136-
* @param code - Optional error code providing a machine-readable identifier for the error.
6136+
* @param code - Error code providing a machine-readable identifier for the error.
61376137
* @param source - The source system or component where the error originated.
61386138
* @param details - Additional error details providing context-specific information.
61396139
*
61406140
* @example
61416141
* ```js
61426142
* { errorType: 'API', message: 'API call failed', code: 'TS-001', source: 'API', details: { request: { url: '/api/rest/2.0/searchdata', method: 'GET' } } }
61436143
* ```
6144-
* @version SDK: 1.44.0 | ThoughtSpot: 10.16.0.cl
6144+
* @version SDK: 1.44.0 | ThoughtSpot: 26.2.0.cl
61456145
*/
61466146
export interface EmbedErrorDetailsEvent {
6147-
errorType: 'API' | 'FULLSCREEN' | 'SINGLE_VALUE_FILTER' | 'NON_EXIST_FILTER' | 'INVALID_DATE_VALUE' | 'INVALID_OPERATOR' | 'VALIDATION_ERROR';
6147+
errorType: 'API' | 'FULLSCREEN' | 'SINGLE_VALUE_FILTER' | 'NON_EXIST_FILTER' | 'INVALID_DATE_VALUE' | 'INVALID_OPERATOR' | 'VALIDATION_ERROR' | string;
61486148
message: string | string[];
61496149
code: string;
6150-
source: 'API' | 'NETWORK' | 'SDK' | 'VALIDATION' | 'UNKNOWN';
6150+
source?: 'API' | 'NETWORK' | 'SDK';
61516151
details?: any;
61526152
}
61536153
export interface DefaultAppInitData {

0 commit comments

Comments
 (0)