Interface CopilotErrorCode

All Known Implementing Classes:
KotlinNotSupportedException, MixedLanguageNotSupportedException, UnsupportedSourceLanguageException

public interface CopilotErrorCode
Implemented by exceptions that carry a machine-readable code, so the frontend can react to why an operation failed instead of parsing the message.

The distinction that matters is between a bug and an expected refusal. A refusal — "Copilot cannot do this to a Kotlin file yet" — should read as a quiet notice, without a stack trace, a Report Issue button, or an error analytics event. Without a code the frontend cannot tell the two apart and has to treat every failure as a bug.

  • Method Summary

    Modifier and Type
    Method
    Description
    A stable, kebab-case identifier for this kind of failure.
    default Map<String,String>
    Extra machine-readable context, merged into the error object sent to the frontend.
  • Method Details

    • getErrorCode

      String getErrorCode()
      A stable, kebab-case identifier for this kind of failure. Sent to the frontend as error.code.
      Returns:
      the error code
    • getErrorDetails

      default Map<String,String> getErrorDetails()
      Extra machine-readable context, merged into the error object sent to the frontend. Keys must not collide with the error object's own fields (message, code, and the exception keys).
      Returns:
      the details, empty by default