Skip to content

Commit 9998423

Browse files
committed
fix: change error logging to warning for unsupported JSON field types in Clickhouse and SQLite connectors
1 parent 01cb54d commit 9998423

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

adminforth/dataConnectors/clickhouse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class ClickhouseConnector extends AdminForthBaseConnector implements IAdminForth
170170
return {'error': `Failed to parse JSON: ${e.message}`}
171171
}
172172
} else {
173-
afLogger.error(`AdminForth: JSON field is not a string but ${field._underlineType}, this is not supported yet`);
173+
afLogger.warn(`AdminForth: JSON field is not a string but ${field._underlineType}, this is not supported yet`);
174174
}
175175
}
176176
return value;
@@ -198,7 +198,7 @@ class ClickhouseConnector extends AdminForthBaseConnector implements IAdminForth
198198
if (field._underlineType.startsWith('String') || field._underlineType.startsWith('FixedString')) {
199199
return JSON.stringify(value);
200200
} else {
201-
afLogger.error(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
201+
afLogger.warn(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
202202
}
203203
}
204204

adminforth/dataConnectors/sqlite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class SQLiteConnector extends AdminForthBaseConnector implements IAdminForthData
123123
return {'error': `Failed to parse JSON: ${e.message}`}
124124
}
125125
} else {
126-
afLogger.error(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
126+
afLogger.warn(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
127127
}
128128
}
129129

@@ -157,7 +157,7 @@ class SQLiteConnector extends AdminForthBaseConnector implements IAdminForthData
157157
if (field._underlineType == 'text' || field._underlineType == 'varchar') {
158158
return JSON.stringify(value);
159159
} else {
160-
afLogger.error(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
160+
afLogger.warn(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
161161
}
162162
}
163163

0 commit comments

Comments
 (0)