Correct format for sending event?

Is this the correct formatting for sending error event to sentry?

Sentry.captureException(error)
let errorMessage = "Unable to do something."
console.log(errorMessage)
Sentry.captureMessage(errorMessage)