Package com.vaadin.copilot.exception
Class MixedLanguageNotSupportedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.vaadin.copilot.exception.CopilotException
com.vaadin.copilot.exception.MixedLanguageNotSupportedException
- All Implemented Interfaces:
CopilotErrorCode,Serializable
public class MixedLanguageNotSupportedException
extends CopilotException
implements CopilotErrorCode
Thrown when a single operation would have to rewrite files in more than one
language at once.
The common cases are safe and stay supported, because an operation resolves
to the files holding the selected component's own create and attach
locations: a Kotlin view under a Java @Layout, or a Java custom
component used inside a Kotlin view. Only a component created in one language
and attached in another is refused, since operations like move, wrap and
extract rewrite both files and would need a coordinated two-language
transaction.
The message names the files, because "created here, attached there" is the part the user needs in order to understand the refusal.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMixedLanguageNotSupportedException(String operation, Collection<File> files) -
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.getFiles()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
-
MixedLanguageNotSupportedException
- Parameters:
operation- the operation that was declined, typically the wire command namefiles- the source files involved, spanning more than one language
-
-
Method Details
-
getOperation
- Returns:
- the declined operation
-
getFiles
- Returns:
- the source files involved
-
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
-