added pre-wrap to preserve newlines
check for empty string on attachment. add exception for bad gateway
added 502 and 503 exception codes
html view for bad gateway
added method for bad gateway