mirror of
https://github.com/xfarrow/blink
synced 2025-02-14 07:50:34 +01:00
Create error_utils.js
This commit is contained in:
parent
35f04d70df
commit
97923faf2c
28
backend/apis/nodejs/src/utils/error_utils.js
Normal file
28
backend/apis/nodejs/src/utils/error_utils.js
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
This code is part of Blink
|
||||
licensed under GPLv3
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
function buildError(type, value, msg, path, location) {
|
||||
return {
|
||||
errors: [{
|
||||
type,
|
||||
value,
|
||||
msg,
|
||||
path,
|
||||
location
|
||||
}]
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
buildError
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user