Skip to content

feat: add throwable usage #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: add throwable usage #23

wants to merge 1 commit into from

Conversation

2-towns
Copy link
Collaborator

@2-towns 2-towns commented May 30, 2025

This PR allows to use throwable object instead of safe value. Example:

import { Codex } from "@codex-storage/sdk-js/throwable";

const marketplace = codex.marketplace;

try {
  const slots = marketplace.activeSlots();
} catch (e) {
  // Do something
}

@AuHau

@2-towns 2-towns marked this pull request as ready for review June 5, 2025 09:48
Copy link
Member

@AuHau AuHau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks a lot! 👍

const marketplace = codex.marketplace;

try {
const slots = marketplace.activeSlots();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const slots = marketplace.activeSlots();
const slots = await marketplace.activeSlots();

Shouldn't it be like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants