parse aws error, extract error code