Learn your broker's rejection codes before you need them
When an order is rejected you get a code and a message, and most of us read the message, shrug, and retry. That's a mistake, because rejections fall into categories that require completely different responses.
The rough taxonomy I now use:
Retry is safe, a transient system condition. Wait, retry, carry on.
Retry is pointless — malformed order, unsupported type, wrong tick size. Retrying sends the identical bad order again; you have a bug.
Retry is dangerous, anything about limits, buying power, or position caps. The rejection is telling you your state is not what you think it is, and hammering it is how you find out the hard way.
The third category is the one that matters. A retry loop that doesn't distinguish these will happily spam a venue with an order that keeps failing for a reason that isn't going away.
Worth building the mapping once, per broker, while nothing is on fire.