Wrapping getMedia in try/catch