Skip to content

feat: define FactoryError variants #103#124

Open
Arome8240 wants to merge 3 commits intoAlien-Protocol:mainfrom
Arome8240:factory-error-variants-103
Open

feat: define FactoryError variants #103#124
Arome8240 wants to merge 3 commits intoAlien-Protocol:mainfrom
Arome8240:factory-error-variants-103

Conversation

@Arome8240
Copy link
Copy Markdown

@Arome8240 Arome8240 commented Mar 24, 2026

fixes #103

Summary by CodeRabbit

  • New Features
    • Introduced standardized error responses for the factory contract with distinct codes for unauthorized access, duplicate deployment attempts, and missing core contract configuration.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 24, 2026

@Arome8240 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 026217de-5818-496f-ae2a-dd721c0c70d0

📥 Commits

Reviewing files that changed from the base of the PR and between 4ebe3d2 and 438236b.

📒 Files selected for processing (1)
  • gateway-contract/contracts/factory_contract/src/errors.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • gateway-contract/contracts/factory_contract/src/errors.rs

📝 Walkthrough

Walkthrough

Adds a new public FactoryError enum with three u32-coded variants and exposes it from the factory contract root via a new errors module re-export in lib.rs. No other logic or control flow was changed.

Changes

Cohort / File(s) Summary
Error Definition
gateway-contract/contracts/factory_contract/src/errors.rs
New public FactoryError enum annotated with #[contracterror], #[repr(u32)], deriving Copy, Clone, Debug, Eq, PartialEq, with variants: Unauthorized = 1, AlreadyDeployed = 2, CoreContractNotConfigured = 3.
Module Declaration & Re-export
gateway-contract/contracts/factory_contract/src/lib.rs
Added mod errors; and pub use errors::FactoryError; to expose the new error type publicly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

Approved

Suggested reviewers

  • ryzen-xp

Poem

🐰 Three little errors hop in line,
Unauthorized, AlreadyDeployed, Core not fine.
I nibble code and stamp my paw,
Factory errors—order, law! ✨🧩

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR implements the FactoryError enum with three variants (Unauthorized, AlreadyDeployed, CoreContractNotConfigured) and imports it in lib.rs, but only defines 3 of the required 4 variants per issue #103 requirements. Define the missing fourth FactoryError variant as specified in issue #103 acceptance criteria to complete the implementation.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: defining FactoryError variants as requested in issue #103.
Out of Scope Changes check ✅ Passed The changes are focused solely on adding the FactoryError enum and its module import, which are directly aligned with issue #103 requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@ryzen-xp ryzen-xp self-requested a review March 24, 2026 12:49
@ryzen-xp ryzen-xp added the CI Failed Please check why you CI is faileing fix your code label Mar 24, 2026
@ryzen-xp
Copy link
Copy Markdown
Contributor

Hello @Arome8240 , Resolve Conflicts and check why this your code failed .

- Remove PartialOrd and Ord derives from FactoryError enum
- Simplify error type to only include necessary comparison traits
- Reduces unnecessary trait implementations for error handling
@Arome8240
Copy link
Copy Markdown
Author

@ryzen-xp

@Arome8240
Copy link
Copy Markdown
Author

fixed @ryzen-xp

@ryzen-xp
Copy link
Copy Markdown
Contributor

hello @Arome8240 , fix your code today .

Copy link
Copy Markdown
Author

@Arome8240 Arome8240 left a comment

Choose a reason for hiding this comment

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

Please review @ryzen-xp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Failed Please check why you CI is faileing fix your code

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

[Factory] Define FactoryError variants in errors.rs

2 participants