Move Error mapper implementation
Move Error mapper implementation

Summary: In the next diff, I want to use this in the body of `errors.ml`, so it has to be above where it's used. To avoid obscuring that diff, I decided to move this code in a separate diff.

Reviewed By: jbrown215

Differential Revision: D10439252

fbshipit-source-id: 0baad51357ece76a765f6ae103facaa01a5c5091

mroch/flow,facebook/flow,facebook/flow,AgentME/flow,mroch/flow,AgentME/flow,facebook/flow,gabelevi/flow,facebook/flow,jamesgpearce/flow,gabelevi/flow,samwgoldman/flow,jamesgpearce/flow,samwgoldman/flow,mroch/flow,samwgoldman/flow,mroch/flow,popham/flow,popham/flow,jamesgpearce/flow,samwgoldman/flow,gabelevi/flow,popham/flow,samwgoldman/flow,popham/flow,popham/flow,gabelevi/flow,facebook/flow,jamesgpearce/flow,jamesgpearce/flow,samwgoldman/flow,mroch/flow,jamesgpearce/flow,samwgoldman/flow,mroch/flow,AgentME/flow,gabelevi/flow,gabelevi/flow,AgentME/flow,AgentME/flow,facebook/flow,popham/flow,mroch/flow,facebook/flow,popham/flow,jamesgpearce/flow,gabelevi/flow