MalformedUrlException class


πŸƒ JetLeaf Framework - https://jetleaf.hapnium.com

Copyright Β© 2025 Hapnium & JetLeaf Contributors. All rights reserved.

This source file is part of the JetLeaf Framework and is protected under copyright law. You may not copy, modify, or distribute this file except in compliance with the JetLeaf license.

For licensing terms, see the LICENSE file in the root of this project.

πŸ”§ Powered by Hapnium β€” the Dart backend engine πŸƒ Thrown to indicate that a malformed URL has occurred.

This exception is used when a Url or Uri string does not conform to expected format or cannot be parsed properly.

Example:

try {
  final url = Url.parse('ht!tp://::invalid-url');
} on MalformedUrlException catch (e) {
  print(e); // MalformedUrlException: Invalid scheme (URL: ht!tp://::invalid-url)
}
Inheritance
Available extensions

Constructors

MalformedUrlException(String message, {Uri? uri})
Thrown to indicate that a malformed URL has occurred.

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
runtimeType β†’ Type
A representation of the runtime type of the object.
no setterinherited
stackTrace β†’ StackTrace
The associated stack trace.
finalinherited
uri β†’ Uri?
The offending URI, if available.
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