Rocky_Mountain_Vending/.pnpm-store/v10/files/b9/31ec1173a5a70d91c43eb5b126cde2d1311575135892299621e0b2e701bd1f556f0eeedbc5dc764be23f7890ee0c74209284e465c6599e1a9e37ef1fb8716b
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

55 lines
1.1 KiB
Text

const os = require('bare-os')
module.exports = class FileError extends Error {
constructor(msg, opts = {}) {
const { code, operation = null, path = null, destination = null, fd = -1 } = opts
if (operation !== null) msg += describe(operation, opts)
super(`${code}: ${msg}`)
this.code = code
if (operation !== null) this.operation = operation
if (path !== null) this.path = path
if (destination !== null) this.destination = destination
if (fd !== -1) this.fd = fd
}
get name() {
return 'FileError'
}
// For Node.js compatibility
get errno() {
return os.constants.errnos[this.code]
}
// For Node.js compatibility
get syscall() {
return this.operation
}
// For Node.js compatibility
get dest() {
return this.destination
}
}
function describe(operation, opts) {
const { path = null, destination = null, fd = -1 } = opts
let result = `, ${operation}`
if (path !== null) {
result += ` ${JSON.stringify(path)}`
if (destination !== null) {
result += ` -> ${JSON.stringify(destination)}`
}
} else if (fd !== -1) {
result += ` ${fd}`
}
return result
}