@stdlib/error-tools-fmtprodmsg
v0.2.2
Published
Format an error message for production.
Downloads
364,128
Readme
fmtprodmsg
Format an error message for production.
Installation
npm install @stdlib/error-tools-fmtprodmsg
Usage
var fmtprodmsg = require( '@stdlib/error-tools-fmtprodmsg' );
fmtprodmsg( code, ...args )
Formats an error message for production.
var msg = fmtprodmsg( '27', 'foo', 'bar' );
// returns 'https://stdlib.io/e/27?arg[]=foo&arg[]=bar'
Examples
var fmtprodmsg = require( '@stdlib/error-tools-fmtprodmsg' );
var msg = fmtprodmsg( '3', 'foo' );
// returns 'https://stdlib.io/e?code=3&arg[]=foo'
msg = fmtprodmsg( '5', 'foo', 'bar' );
// returns 'https://stdlib.io/e/5?arg[]=foo&arg[]=bar'
msg = fmtprodmsg( '5', 'foo', 'bar', 123 );
// returns 'https://stdlib.io/e/5?arg[]=foo&arg[]=bar&arg[]=123'
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.