Serverless is slowly becoming the new norm and with that much traction around this all-new-way to run applications is only normal that developers from all over have been jumping at the chance to test it out. However, not every programming language is the same and some have some distinct pitfalls one will want to avoid. Here is what you need to look out for if you are going to snake yourself into using serverless. Get it? Python is a kind of snake. No? Fine, I’ll stop.

It doesn’t matter if you are fluent in python or just dipping your toes in the scripting language sooner or later you will encounter an error. Python error handling might seem hard to most newbies but once you get used to what you need to look at you’ll be fine.

Syntax error

One of the most common errors you will get is called a parsing error. The more common term is “syntax error”. It happens to everyone once in a while: you type a code and misplace a comma or forget to add a colon in the print() function. Seems simple yet that dreaded comma has plagued developers since the beginning of time.

Exceptions

Then there are the errors caused by the execution of a python script. In this case, the python error comes in the form of a so-called “exception”. One such example is KeyError which appears at execution if a mapping key is not found among existing keys. Another python error handling output is MemoryError which is invoked when you run out of memory while running a python script.

#python #quick introduction #python errors and exceptions

A quick introduction to Python errors and exceptions
1.05 GEEK