Skip to content

Add 10-character error codes to system errors#12

Merged
TheBjoRedCraft merged 5 commits intofeat/error-logging-systemfrom
copilot/add-error-code-for-system-errors
Feb 8, 2026
Merged

Add 10-character error codes to system errors#12
TheBjoRedCraft merged 5 commits intofeat/error-logging-systemfrom
copilot/add-error-code-for-system-errors

Conversation

Copy link

Copilot AI commented Feb 8, 2026

System errors lacked human-readable error codes for support and debugging. Player errors already have 7-character alphanumeric codes; system errors now get 10-character codes using the same generation pattern.

Changes

  • Schema: Added errorCode varchar(10) with unique index to SurfCoreSystemErrorTable
  • Data model: Added errorCode: String to SurfCoreSystemError
  • Service: Added generateCode() (62^10 possible combinations) and getError(code: String)
  • Repository: Generate codes on insert, preserve on update, support code-based queries
  • Commands: Added /coreerror system viewCode <code> subcommand to look up errors by code
  • UI: Updated error list pagination to display error codes instead of UUIDs
  • Logging: Error codes are now logged alongside UUIDs in GlobalErrorHandler

Error codes are case-sensitive alphanumeric (0-9, a-z, A-Z). Database unique constraint prevents collisions.

// Generated error codes
"bSMRsZqeod"  // 10 chars
"LsGOUJdpk3"
"W9vnMbJD2K"

// Retrieve by code
val error = surfCoreSystemErrorService.getError("bSMRsZqeod")

// View in command
/coreerror system viewCode bSMRsZqeod

Error codes appear in server logs when errors occur:

This error has been logged with code: bSMRsZqeod (ID: 123e4567-e89b-12d3-a456-426614174000)

[!WARNING]

Original prompt

Please add a error code like in the player error system for system errors, code should be 10 char long, every letter, case sensitive and numbers


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 8, 2026 16:40
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Copilot AI changed the title [WIP] Add error code for system errors with specified format Add 10-character error codes to system errors Feb 8, 2026
Copilot AI requested a review from TheBjoRedCraft February 8, 2026 16:44
@TheBjoRedCraft
Copy link
Member

@copilot please use the errorcode in the command and in the log to identifythe error

Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 8, 2026

@copilot please use the errorcode in the command and in the log to identifythe error

Done! System errors now use error codes throughout:

In logs: Error codes are logged alongside UUIDs:

This error has been logged with code: bSMRsZqeod (ID: 123e4567-e89b-12d3-a456-426614174000)

In commands:

  • /coreerror system viewCode <code> - Look up errors by code (like player errors)
  • /coreerror system list - Shows error codes instead of UUIDs in the list
  • Error details view shows both error code and UUID

Commit: 102b407

@TheBjoRedCraft TheBjoRedCraft marked this pull request as ready for review February 8, 2026 16:47
@TheBjoRedCraft TheBjoRedCraft merged commit 5afb70a into feat/error-logging-system Feb 8, 2026
@TheBjoRedCraft TheBjoRedCraft deleted the copilot/add-error-code-for-system-errors branch February 8, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants