Package com.vaadin.copilot.exception
Class UnsupportedSourceLanguageException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.vaadin.copilot.exception.CopilotException
com.vaadin.copilot.exception.UnsupportedSourceLanguageException
- All Implemented Interfaces:
CopilotErrorCode,Serializable
- Direct Known Subclasses:
KotlinNotSupportedException
public class UnsupportedSourceLanguageException
extends CopilotException
implements CopilotErrorCode
Thrown when Copilot understands the request but cannot carry it out for this
source language yet.
This is a refusal, not a bug: the operation is simply not implemented for the
language, so the frontend should say so plainly rather than reporting a
failure. The operation is the wire command name where there is one,
so the message can name what was declined.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionUnsupportedSourceLanguageException(SourceLanguage language, String operation) protectedUnsupportedSourceLanguageException(String message, SourceLanguage language, String operation) Allows a subclass to keep a pre-existing message while still carrying the error code. -
Method Summary
Modifier and TypeMethodDescriptionA stable, kebab-case identifier for this kind of failure.Extra machine-readable context, merged into the error object sent to the frontend.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
ERROR_CODE
- See Also:
-
-
Constructor Details
-
UnsupportedSourceLanguageException
- Parameters:
language- the language that is not supported for this operationoperation- the operation that was declined, typically the wire command name
-
UnsupportedSourceLanguageException
protected UnsupportedSourceLanguageException(String message, SourceLanguage language, String operation) Allows a subclass to keep a pre-existing message while still carrying the error code.- Parameters:
message- the message to reportlanguage- the language that is not supported, may benulloperation- the operation that was declined, may benull
-
-
Method Details
-
getLanguage
- Returns:
- the unsupported language, may be
nullwhen not known
-
getOperation
- Returns:
- the declined operation, may be
nullwhen not known
-
getErrorCode
Description copied from interface:CopilotErrorCodeA stable, kebab-case identifier for this kind of failure. Sent to the frontend aserror.code.- Specified by:
getErrorCodein interfaceCopilotErrorCode- Returns:
- the error code
-
getErrorDetails
Description copied from interface:CopilotErrorCodeExtra 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).- Specified by:
getErrorDetailsin interfaceCopilotErrorCode- Returns:
- the details, empty by default
-