Add error code to DatabaseError class