A runtime error is an error that occurs while software is executing. This can be contrasted with a compile-time error that is detected when code is being built before it is run. All errors detected by users are typically runtime errors. As such, if you are a user who receives a "runtime error" message, this is essentially meaningless. The following are common types of runtime error.
Logical ErrorsLogical errors such as failing to check if a file is empty before parsing its first line.
Invalid OperationsTrying to do things that can't be done such as division by zero.
Input HandlingFailing to properly validate user input and then making incorrect assumptions about that data. For example, assuming that users haven't put any non-numeric characters into a "quantity" field such that code fails when it tries use this data as a number.
ParsingErrors related to understanding text such as scanning for "jpg" anywhere in a filename to determine a file type. This might cause a runtime error for a filename such as "jpg at the lake.mov."
Out of BoundsLooking for things in data structures using impossible addresses. For example, trying to access position -1 in a list where positions start at 0.
Unhandled data conditions. For example, a spreadsheet that assumes that a file has author related metadata such that it generates an error if this field is empty.
IntegrationAn error in requesting services. For example, a banking website that can't connect to a banking system that provides account balances.Code that incorrectly assumes that a variable has been initialized generating a null pointer error. For example, assuming that all customers in a database have a phone number set when some do not.
ResourcesCode that eats up too many resources such as an infinite loop or code that is unable to secure resources it assumes will be present such as enough memory to process a large media file.
I/OErrors in input and output. For example, an failed call to create a local file due to file permissions.
SynchronizationProblems that occur with multiple processes accessing the same resource at the same time. For example, multiple threads of code that try to change the same data at the same time without properly synchronizing these updates.
NotesRuntime errors can be difficult to fix because they may impact a small number of users and be difficult to recreate. For example, a social media script that works fine on a high speed, low latency connection where the developer is sitting that starts generating runtime errors in areas where internet is slow and unreliable.
This is the complete list of articles we have written about computing basics.
If you enjoyed this page, please consider bookmarking Simplicable.
© 2010-2023 Simplicable. All Rights Reserved. Reproduction of materials found on this site, in any form, without explicit permission is prohibited.
View credits & copyrights or citation information for this page.