name: duk_push_error_object_va

proto: |
  duk_idx_t duk_push_error_object_va(duk_context *ctx, duk_errcode_t err_code, const char *fmt, va_list ap);

stack: |
  [ ... ] -> [ ... err! ]

summary: |
  <p>Vararg variant of
  <code><a href="#duk_push_error_object">duk_push_error_object()</a></code>.</p>

example: |
  duk_idx_t my_type_error(duk_context *ctx, const char *fmt, ...) {
      va_list ap;
      duk_idx_t err_idx;

      va_start(ap, fmt);
      err_idx = duk_push_error_object_va(ctx, fmt, ap);
      va_end(ap);

      return err_idx;
  }

tags:
  - stack
  - object
  - error
  - vararg

seealso:
  - duk_push_error_object

introduced: 1.1.0

name: duk_push_error_object_va

proto: |
  duk_idx_t duk_push_error_object_va(duk_context *ctx, duk_errcode_t err_code, const char *fmt, va_list ap);

stack: |
  [ ... ] -> [ ... err! ]

summary: |
  <p>Vararg variant of
  <code><a href="#duk_push_error_object">duk_push_error_object()</a></code>.</p>

example: |
  duk_idx_t my_type_error(duk_context *ctx, const char *fmt, ...) {
      va_list ap;
      duk_idx_t err_idx;

      va_start(ap, fmt);
      err_idx = duk_push_error_object_va(ctx, DUK_ERR_TYPE_ERROR, fmt, ap);
      va_end(ap);

      return err_idx;
  }

tags:
  - stack
  - object
  - error
  - vararg

seealso:
  - duk_push_error_object

introduced: 1.1.0

Fix missing parameter in the example
Fix missing parameter in the example

Fix missing `err_code` parameter to `duk_push_error_object_va` in the example. Use `DUK_ERR_TYPE_ERROR` like in the `duk_push_error_object()` example.
