slymnoyann/hey-1 · error · Error
Something went wrong!
Error message
Something went wrong!
What it means
Thrown by uploadMetadata when storageClient.uploadAsJson rejects or throws for any reason; the original error is swallowed and replaced with a generic SomethingWentWrong. This wraps metadata JSON uploads (e.g. NFT/app metadata) to IPFS storage with an ACL tied to the chain id.
Source
Thrown at src/helpers/uploadMetadata.ts:20
import { CHAIN } from "@/data/constants";
import { ERRORS } from "@/data/errors";
import { storageClient } from "./storageClient";
interface MetadataPayload {
[key: string]: unknown;
}
const uploadMetadata = async (
data: MetadataPayload | null
): Promise<string> => {
try {
const { uri } = await storageClient.uploadAsJson(data, {
acl: immutable(CHAIN.id)
});
return uri;
} catch {
throw new Error(ERRORS.SomethingWentWrong);
}
};
export default uploadMetadata;
View on GitHub (pinned to 88c8f9d553)
Solutions
- Inspect the original caught error (log it before rethrowing) to identify the real cause
- Verify storage client credentials and endpoint configuration against .env.example
- Confirm CHAIN.id and the immutable() acl helper produce values the storage service accepts
- Add retry with backoff for transient storage service failures instead of immediately surfacing the generic error
Example fix
// before
} catch {
throw new Error(ERRORS.SomethingWentWrong);
}
// after
} catch (e) {
console.error("uploadMetadata failed:", e);
throw new Error(ERRORS.SomethingWentWrong);
} Defensive patterns
Strategy: fallback
Validate before calling
if (data == null || typeof data !== "object") {
throw new Error("Invalid metadata payload");
}
try { JSON.stringify(data); } catch {
throw new Error("Metadata is not JSON-serializable");
} Type guard
const isSerializable = (d: unknown): d is Record<string, unknown> =>
typeof d === "object" && d !== null && (() => { try { JSON.stringify(d); return true; } catch { return false; } })(); Try / catch
try {
const uri = await uploadMetadata(data);
} catch (e) {
if (e instanceof Error && e.message === "Something went wrong!") {
// retry once with backoff, then surface a specific message
}
throw e;
} Prevention
- Log the original error inside the catch before replacing it with the generic message
- Validate env config for the storage client at app startup
- Rate-limit bulk metadata uploads to stay under service quotas
When it happens
Trigger: Calling uploadMetadata when the storage client is misconfigured (wrong endpoint/keys), the JSON payload is not serializable, the storage service rate-limits or returns 5xx, or the acl/immutable(CHAIN.id) argument is invalid for the configured chain.
Common situations: Missing or expired storage service API keys in env, incorrect CHAIN.id after a chain config change, rate limiting during bulk metadata uploads, or a storage SDK version whose uploadAsJson signature changed so options are rejected.
Related errors
- uploadFileToIPFS failed
- Failed to upload file
- Please wait for attachments to finish uploading.
- Some attachments failed to upload
- Something went wrong!
AI-assisted analysis of slymnoyann/hey-1@88c8f9d553 (2026-08-28).
Data as JSON: /api/errors/1380b34a39672f4c.
Report an issue: GitHub.