11cb0ef41Sopenharmony_ci// Flags: --expose-internals --frozen-intrinsics 21cb0ef41Sopenharmony_ci'use strict'; 31cb0ef41Sopenharmony_cirequire('../common'); 41cb0ef41Sopenharmony_ciconst assert = require('assert'); 51cb0ef41Sopenharmony_ciconst { E, SystemError, codes } = require('internal/errors'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciE('ERR_TEST', 'custom message', SystemError); 81cb0ef41Sopenharmony_ciconst { ERR_TEST } = codes; 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ciconst ctx = { 111cb0ef41Sopenharmony_ci code: 'ETEST', 121cb0ef41Sopenharmony_ci message: 'code message', 131cb0ef41Sopenharmony_ci syscall: 'syscall_test', 141cb0ef41Sopenharmony_ci path: '/str', 151cb0ef41Sopenharmony_ci dest: '/str2' 161cb0ef41Sopenharmony_ci}; 171cb0ef41Sopenharmony_ciassert.throws( 181cb0ef41Sopenharmony_ci () => { throw new ERR_TEST(ctx); }, 191cb0ef41Sopenharmony_ci { 201cb0ef41Sopenharmony_ci code: 'ERR_TEST', 211cb0ef41Sopenharmony_ci name: 'SystemError', 221cb0ef41Sopenharmony_ci info: ctx, 231cb0ef41Sopenharmony_ci } 241cb0ef41Sopenharmony_ci); 25