(hub: Hub, pluginError: PluginError | null, pluginConfig: PluginConfig)
| 113 | } |
| 114 | |
| 115 | export 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 | |
| 133 | export async function disablePlugin(hub: Hub, pluginConfigId: PluginConfigId): Promise<void> { |
| 134 | await hub.db.postgresQuery( |
no test coverage detected
searching dependent graphs…