I am facing this issue regularly while trying to migrate bunch of contracts but it get failed because of this issue . I am running over testrpc , i tried lot of recommendations over stack exchange and github issues but all are failed. I tried by increasing gas limit(800000) in truffle.js also but it didn't work.
Full error message -
(node:14587) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: The contract code couldn't be stored, please check your gas amount. (node:14587) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Truffle v4.0.1 (core: 4.0.1)
Solidity v0.4.18 (solc-js)
EthereumJS TestRPC v4.1.3 (ganache-core: 1.1.3)
Can anybody suggest me possible solution of that? Thanks in Advance.