MCPcopy Index your code
hub / github.com/PostHog/posthog / setError

Function setError

plugin-server/src/utils/db/sql.ts:115–131  ·  view source on GitHub ↗
(hub: Hub, pluginError: PluginError | null, pluginConfig: PluginConfig)

Source from the content-addressed store, hash-verified

113}
114
115export async function setError(hub: Hub, pluginError: PluginError | null, pluginConfig: PluginConfig): Promise<void> {
116 await hub.db.postgresQuery(
117 'UPDATE posthog_pluginconfig SET error = $1 WHERE id = $2',
118 [pluginError, typeof pluginConfig === 'object' ? pluginConfig?.id : pluginConfig],
119 'updatePluginConfigError'
120 )
121 if (pluginError) {
122 await hub.db.queuePluginLogEntry({
123 pluginConfig,
124 source: PluginLogEntrySource.Plugin,
125 type: PluginLogEntryType.Error,
126 message: pluginError.stack ?? pluginError.message,
127 instanceId: hub.instanceId,
128 timestamp: pluginError.time,
129 })
130 }
131}
132
133export async function disablePlugin(hub: Hub, pluginConfigId: PluginConfigId): Promise<void> {
134 await hub.db.postgresQuery(

Callers 3

processErrorFunction · 0.90
clearErrorFunction · 0.90
sql.test.tsFile · 0.90

Calls 2

postgresQueryMethod · 0.80
queuePluginLogEntryMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…