save error type to database