Learn English – Why exactly is the verb “to throw” used when an error occurs in the program

computingexpressionsprogramming

Why don't we use "to generate" or "to get"?

E.g.:
"External component has thrown an exception", "JavaScript had just thrown an error straight away", "Instances of Error objects are thrown when runtime errors occur".

Best Answer

see: https://en.wikipedia.org/wiki/Exception_handling at History

"... Software exception handling developed in Lisp in the 1960s and 1970s. This originated in LISP 1.5 (1962), where exceptions were caught by the ERRSET keyword, which returned NIL in case of an error, instead of terminating the program or entering the debugger.[10] Error raising was introduced in MacLisp in the late 1960s via the ERR keyword.[10] This was rapidly used not only for error raising, but for non-local control flow, and thus was augmented by two new keywords, CATCH and THROW (MacLisp June 1972), reserving ERRSET and ERR for error handling. ..."