output error details if post unsuccessfully

output error details if post unsuccessfully