PrivateMethodInvocationException class final

Exception thrown when a developer attempts to invoke a private method dynamically, which is not allowed by JetLeaf.

This occurs when:

  • The method name starts with _
  • The framework or runtime prohibits direct invocation of private members

Extends RuntimeResolverException, preserving message, cause, and stack trace.

Usage Example

throw PrivateMethodInvocationException(MyService, "_secretMethod");

Design Notes

  • Clearly distinguishes private method invocation errors from missing methods
  • Provides the type and method name for easy debugging
Inheritance
Available extensions

Constructors

PrivateMethodInvocationException(Object type, String methodName, {Object? cause, StackTrace? stack})
Creates a new PrivateMethodInvocationException

Properties

cause Object?
The underlying cause of this exception, if any.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
message String
The message describing the error.
finalinherited
methodName String
The private method name
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace
The associated stack trace.
finalinherited
type Object
The type on which the private method was attempted to be invoked
final

Methods

getCause() Object
The cause of this exception, if any.
inherited
getMessage() String
The message associated with this exception.
inherited
getStackTrace() StackTrace
The stack trace associated with this exception.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printStackTrace([bool useErrorPrint = false]) → void

Available on Error, provided by the ErrorExtensions extension

Prints the error along with its stack trace.
printStackTrace([StackTrace? stacktrace, bool useErrorPrint = false]) → void

Available on Exception, provided by the ExceptionExtensions extension

Prints the exception and optional StackTrace if available.
printStackTrace([bool useErrorPrint = false]) → void

Available on RuntimeException, provided by the RuntimeExceptionExtensions extension

Extension on RuntimeException to support pretty stack trace printing.
printStackTrace([bool useErrorPrint = false]) → void

Available on Throwable, provided by the ThrowableExtensions extension

Extension on Throwable to support printing stack traces in a unified way.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited