# 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
  - Object
  - Error
  - RuntimeException
  - MalformedUrlException
Available extensions
  - ErrorExtensions
  - ExceptionExtensions
  - RuntimeExceptionExtensions
  - ThrowableExtensions

## Constructors

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

## Properties

cause → Object?
  The underlying cause of this exception, if any.
  final inherited
hashCode → int
  The hash code for this object.
  no setter inherited
message → String
  The message describing the error.
  final inherited
runtimeType → Type
  A representation of the runtime type of the object.
  no setter inherited
stackTrace → StackTrace
  The associated stack trace.
  final inherited
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