Skip to main content

A centralized error code library for microservices

Project description

central-error-codes

Setup Instructions

Prerequisites

  • Ensure you have Node.js and Python 3 installed on your system.
  • Install npm and pip for managing dependencies.

Installation

Clone the Repository

 git clone <repo-url>
 cd central-error-codes

Setup Node.js Module

cd src/typescript
npm install
npm run build

Setup Python Module

cd src/python
pip install -r requirements.txt
python3 setup.py install

Usage

Using Node.js Module in Another Project

npm install /path/to/central-error-codes

Import in your project:

import ErrorCode from 'central-error-codes';
ErrorCode.getGenericError();

Using Python Module in Another Project

pip install /path/to/central-error-codes/dist/python_package.tar.gz

Import in your Python script:

from cagent_errorcode import ErrorCode
ErrorCode.get_generic_error()

Building Both Modules in One Command

npm run build

Ensure that package.json has:

"scripts": {
  "build": "npm run build && python3 setup.py sdist"
}

Troubleshooting

  • If you face ModuleNotFoundError: No module named 'setuptools', install it using:
    pip install setuptools
    
  • If tsc is not found, install TypeScript globally:
    npm install -g typescript
    

For any issues, feel free to raise a GitHub issue in the repository!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

central_error_codes-1.0.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

central_error_codes-1.0.0-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

File details

Details for the file central_error_codes-1.0.0.tar.gz.

File metadata

  • Download URL: central_error_codes-1.0.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for central_error_codes-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8def5aaf91b33995ef0ec16a64215f80d56a235242922a7ba5c22f416f134b63
MD5 de867f79d40e03d1b9800408c07fe9cf
BLAKE2b-256 cf6857a9abc40f29a5ecf149d8f4896cdf0552092aecaeb0c5d1cc3a4fa8112e

See more details on using hashes here.

File details

Details for the file central_error_codes-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for central_error_codes-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4931e9be6d3eb4a489b2c6ac9a9e0e71084674bc043d007ab7e8ac6e04e9189e
MD5 897c3f1485cdc39570f200c3d9c230b8
BLAKE2b-256 65149d88f9713400ca46ac83af6eac5a2029fe54cfa524bde0907fb4616af467

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page