Skip to content

Commit

Permalink
enh: better quota error (#3346)
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu authored Jan 21, 2024
1 parent 15f5bc6 commit 4c009bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ async function handler(
api_error: {
type: "data_source_quota_error",
message:
"Data sources are limited to 32 documents on our free plan. Contact [email protected] if you want to increase this limit.",
`Data sources are limited to ${plan.limits.dataSources.documents.count} ` +
`documents on your current plan. Contact [email protected] if you want to increase this limit.`,
},
});
}
Expand All @@ -238,7 +239,10 @@ async function handler(
api_error: {
type: "data_source_quota_error",
message:
"Data sources document upload size is limited to 1MB. Contact [email protected] if you want to increase it.",
`Data sources document upload size is limited to ` +
`${plan.limits.dataSources.documents.sizeMb}MB on your current plan. ` +
`You are attempting to upload ${fullText.length} bytes. ` +
`Contact [email protected] if you want to increase it.`,
},
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ async function handler(
api_error: {
type: "data_source_quota_error",
message:
"Data sources are limited to 32 documents on our free plan. Contact [email protected] if you want to increase this limit.",
`Data sources are limited to ${plan.limits.dataSources.documents.count} ` +
`documents on your current plan. Contact [email protected] if you want to increase this limit.`,
},
});
}
Expand All @@ -180,7 +181,10 @@ async function handler(
api_error: {
type: "data_source_quota_error",
message:
"Data sources document upload size is limited to 1MB. Contact [email protected] if you want to increase it.",
`Data sources document upload size is limited to ` +
`${plan.limits.dataSources.documents.sizeMb}MB on your current plan. ` +
`You are attempting to upload ${fullText.length} bytes. ` +
`Contact [email protected] if you want to increase it.`,
},
});
}
Expand Down

0 comments on commit 4c009bf

Please sign in to comment.