[cleanup] helper function for converting module errors
[cleanup] helper function for converting module errors

Summary: extracted a helper function to aid readability

Reviewed By: nmote

Differential Revision: D20735957

fbshipit-source-id: 562e5cb4ced9a7f01d6609b046b00fe7dae251b7

nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow