Skip to content

Commit

Permalink
feat(error): add error code for each error
Browse files Browse the repository at this point in the history
  • Loading branch information
emkis committed Mar 19, 2023
1 parent 13611dc commit 75b550a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/shared/configuration/configuration-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EventTrackerError } from '@/shared/error'
export function throwNoConfigurationProvided() {
const message =
process.env.NODE_ENV === 'production'
? '1'
? '0'
: `You've called configure function without a configuration object.`

throw new EventTrackerError(message)
Expand Down
4 changes: 2 additions & 2 deletions src/shared/data-layer/data-layer-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function throwIsServer() {
export function throwIsNotDefined() {
const message =
process.env.NODE_ENV === 'production'
? '1'
? '2'
: `The targetProperty is not defined. Make sure you didn't forget to add Google Tag Manager's script in your application. If you did but you don't use the default 'window.dataLayer' array, you can set your custom targetProperty with the configure function.`

throw new EventTrackerError(message)
Expand All @@ -21,7 +21,7 @@ export function throwIsNotDefined() {
export function throwIsNotArray() {
const message =
process.env.NODE_ENV === 'production'
? '1'
? '3'
: `The targetProperty is not an array. Either you didn't installed Google Tag Manager correctly or you configured the targetProperty incorrectly.`

throw new EventTrackerError(message)
Expand Down

0 comments on commit 75b550a

Please sign in to comment.