mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
feat: Track node errors on PostHog (#8774)
Co-authored-by: Marcus <marcus@n8n.io>
This commit is contained in:
parent
c7c17673cb
commit
35f6826150
|
@ -598,6 +598,7 @@ import { useToast } from '@/composables/useToast';
|
|||
import { isEqual, isObject } from 'lodash-es';
|
||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||
import { useSourceControlStore } from '@/stores/sourceControl.store';
|
||||
import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
import RunDataPinButton from '@/components/RunDataPinButton.vue';
|
||||
|
||||
const RunDataTable = defineAsyncComponent(
|
||||
|
@ -738,12 +739,38 @@ export default defineComponent({
|
|||
this.setDisplayMode();
|
||||
this.activatePane();
|
||||
}
|
||||
|
||||
if (this.hasRunError) {
|
||||
const error = this.workflowRunData?.[this.node.name]?.[this.runIndex]?.error;
|
||||
const errorsToTrack = ['unknown error'];
|
||||
|
||||
if (error && errorsToTrack.some((e) => error.message.toLowerCase().includes(e))) {
|
||||
this.$telemetry.track(
|
||||
`User encountered an error: "${error.message}"`,
|
||||
{
|
||||
node: this.node.type,
|
||||
errorMessage: error.message,
|
||||
nodeVersion: this.node.typeVersion,
|
||||
n8nVersion: this.rootStore.versionCli,
|
||||
},
|
||||
{
|
||||
withPostHog: true,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.hidePinDataDiscoveryTooltip();
|
||||
},
|
||||
computed: {
|
||||
...mapStores(useNodeTypesStore, useNDVStore, useWorkflowsStore, useSourceControlStore),
|
||||
...mapStores(
|
||||
useNodeTypesStore,
|
||||
useNDVStore,
|
||||
useWorkflowsStore,
|
||||
useSourceControlStore,
|
||||
useRootStore,
|
||||
),
|
||||
isReadOnlyRoute() {
|
||||
return this.$route?.meta?.readOnlyCanvas === true;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue