-
Notifications
You must be signed in to change notification settings - Fork 71
feat/user-exception #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat/user-exception #193
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||||||||||||||||||||||
| import { DomainException } from "@/modules/shared/domain/exceptions/domain.exception"; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export class InvalidUserDataException extends DomainException { | ||||||||||||||||||||||||||
| constructor(field: string, value: string) { | ||||||||||||||||||||||||||
| super(`Invalid ${field}: ${value}`); | ||||||||||||||||||||||||||
|
Comment on lines
+5
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don’t interpolate user-provided values into error messages (PII leak). Including raw values (e.g., email, phone, token) in messages/logs is risky. Prefer generic messages and carry details as structured, non-sensitive metadata. Apply this diff: -export class InvalidUserDataException extends DomainException {
- constructor(field: string, value: string) {
- super(`Invalid ${field}: ${value}`);
- }
-}
+export class InvalidUserDataException extends DomainException {
+ readonly code = 'USER_INVALID_DATA' as const;
+ readonly field: string;
+
+ constructor(field: string, _value?: unknown) {
+ super(`Invalid ${field}`);
+ this.name = new.target.name;
+ this.field = field;
+ }
+}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify “@” path alias resolution in build/tests.
Ensure tsconfig paths and test runners map "@/..." correctly to avoid runtime/import failures.
🏁 Script executed:
Length of output: 860
Add missing TypeScript path alias in tsconfig.json
In tsconfig.json, set
compilerOptions.baseUrlto"src"and add undercompilerOptions.pathsso that imports like
@/…resolve at build time.🤖 Prompt for AI Agents