TypeError: super().__init__() Missing Arguments

TypeError: __init__() missing 1 required positional argument: 'message'

Quick Answer

Your subclass is not passing required arguments to the parent __init__. Make sure super().__init__() receives all arguments the parent class expects.

Why This Happens

When subclassing, you must call the parent __init__ with required arguments. If the parent expects parameters but you call super().__init__() without them, Python raises TypeError.

The Problem

class AppError(Exception):
    def __init__(self, code):
        super().__init__()
        self.code = code

The Fix

class AppError(Exception):
    def __init__(self, message, code):
        super().__init__(message)
        self.code = code

raise AppError('Something failed', 500)

Step-by-Step Fix

  1. 1

    Check parent __init__

    Look at what arguments the parent class expects.

  2. 2

    Pass required arguments

    Forward all necessary arguments to super().__init__().

  3. 3

    Document the interface

    Make it clear what arguments your subclass constructor expects.

Got the actual stack trace?

Paste it into our free AI explainer to get the cause and the fix for your specific case — no signup, nothing to install.

Explain my error

Bugsly catches this automatically

Bugsly's AI analyzes this error pattern in real-time, explains what went wrong in plain English, and suggests the exact fix — before your users even report it.

Try Bugsly free