Check for an error, then print and clear it

Some errors are not fatal, so we ignore them at this level.

Property definitions

sdl2 :: minimal $ Sys :: check_error
# Check for an error, then print and clear it
#
# Some errors are not fatal, so we ignore them at this level.
fun check_error(loc: String)
do
	var error = sys.sdl.error.to_s
	if not error.is_empty then
		print "at {loc}: {error}"
		sys.sdl.clear_error
	end
end
lib/sdl2/examples/minimal/src/minimal.nit:22,1--32,3