Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

840 B
Raw Blame
print('start')
try {
  print('try')
} catch (e) {
  print(f'{e} was the exception')
}


print('------------------')

print('start')
try {
  print('try')
} catch {
  print('No var for error, but no error')
}

print('------------------')

try {
  print('try again')
  throw Error()
} catch (e) {
  print(f'{e} was the exception')
}

print('------------------')

try {
  print('try again')
  throw Error()
} catch {
  print('No var for error')
}

print('------------------')

fun third() {
  print('Throwing in third')
  throw Error('Threw in third')
}

fun second() {
  print('second')
  third()
}

fun first() {
  print('first')
  second()
}

fun base() {
  print('base')
  try {
    first()
  } catch (e) {
    print(f'Caught in base: {e}')
    throw e
  }
}

try {
  base()
} catch (e) {
  print(f'Caught in root: {e}')
}
print('The end')