Erlang (programming language)/Tutorials/otp design
Jump to navigation
Jump to search
Fail early and often
Fail early and often is a strange and unusual programming method used in OTP. Processes are programed to a specification about how to handle good input. If bad input is seen by a worker process we let the process crash. The supervisor restarts the process and the bad input is ignored. Fail early and often works well with any type of data flow situation when a program is processing a flow of messages. Logically, security and stability is increased by limiting the propagation of errors to other processes.