RuntimeError
A general built-in exception for errors that fit no more specific category.
In more detail
Prefer a more precise exception, such as ValueError or a custom exception class, when one fits; RuntimeError is the last resort. Python itself raises it in a few situations, such as a dictionary changing size while a loop is going through it.
Related terms
- exception — An error object a program raises to stop normal flow and report that something went wrong.
- traceback — The report Python prints when an unhandled exception stops a program, listing the chain of calls that led there and ending with the error.
Taught in
- Streaming Responses — AI Engineering: LLM Apps, RAG & Agents
- Raising, And Writing Your Own Exception — Hands-on Python: Complete Video Course & Book
- Mock, Review And Exam Day — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Handlers, args, raise And assert — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep