Add logging for scopeid error (#8513)

Can't figure out https://github.com/twentyhq/twenty/issues/8347 so I'm
adding logs, maybe it'll help debug in the future!
This commit is contained in:
Félix Malfait 2024-11-15 14:16:09 +01:00 committed by GitHub
parent 30bcdda323
commit bd18eb8b42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -15,7 +15,9 @@ permissions:
statuses: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# We don't cancel in-progress because this workflow is triggered on
# pull_request_target, which means the ref can be the same accross two PRs.
# cancel-in-progress: true
jobs:
danger-js:

View File

@ -17,6 +17,10 @@ export const useAvailableScopeIdOrThrow = <T extends { scopeId: string }>(
} else if (isNonEmptyString(scopeIdFromContext)) {
return scopeIdFromContext;
} else {
throw new Error('Scope id is not provided and cannot be found in context.');
throw new Error(
`Scope id is not provided and cannot be found in context.\n` +
`Context: ${Context.displayName || 'Unknown'}\n` +
`ScopeInternalContext.scopeId: ${scopeInternalContext?.scopeId || 'Unknown'}`,
);
}
};