 			stream.abort()
 
 	stream.on 'end', Meteor.bindEnvironment ->
+		if error?
+			return callback null, {
+				error: error
+				parsedUrl: parsedUrl
+			}
+
 		buffer = Buffer.concat(chunks)
 
 		callback null, {


	headers = null
	statusCode = null
	chunks = []
	chunksTotalLength = 0


			statusCode: statusCode
		}

	stream.on 'error', (err) ->
		error = err

OEmbed.getUrlMeta = (url, withFragment) ->
	getUrlContentSync = Meteor.wrapAsync getUrlContent
