Error Handling
Configure how the extension handles E-Invoice generation failures.
Blocking Document Creation on Error
The primary “hard stop” control is blocking document creation when E-Invoice generation fails.
Configuration
Go to Stores >Configuration > MageB2B > E-Invoice:
| Setting | Behavior |
|---|---|
| Invoice Settings → Block Invoice on E-Invoice Error | Prevent invoice creation if generation fails |
| Credit Memo Settings → Block Credit Memo on E-Invoice Error | Prevent credit memo creation if generation fails |
Error Types
Validation Errors
E-Invoice doesn't meet format requirements:
- Missing required fields (VAT ID, etc.)
- Invalid data formats
- XSD schema violations
Generation Errors
Technical failures during generation:
- PDF generation failed
- XML creation error
- File storage error
Configuration Errors
Missing or invalid configuration:
- Company data incomplete
- Invalid IBAN/BIC format
- Missing seller contact details (XRechnung BR-DE-2)
Error Notifications
Enable Notifications
Stores >Configuration > MageB2B > E-Invoice > Validation & Error Handling:
| Setting | Description | Default |
|---|---|---|
| Enable Error Notifications | Send email on failures | No |
| Error Notification Email | Recipient address | - |
| Error Notification Threshold | Send after X consecutive failures | 3 |
Notification Contents
Email includes:
- Invoice increment ID
- Error message
- Timestamp
- Store view
- Link to invoice in admin
Batch Error Notifications
For cron/queue modes, batch notifications are sent:
- After configured threshold is reached
- Summary of all failed invoices
- Individual error details
Error Recovery
Manual Retry
- Go to Sales >Invoices
- Open the failed invoice
- Click Generate E-Invoice
For credit memos, use Sales >Credit Memos and run Generate E-Invoice from the document view.
Mass Retry
- Go to Sales >Invoices
- Filter by status "error"
- Select invoices
- Choose Generate E-Invoice (mass action)
Common Errors
"VAT ID is required"
Cause: Company VAT ID not configured
Solution: Configure VAT ID in E-Invoice settings
"Invalid IBAN format"
Cause: IBAN doesn't pass validation
Solution: Verify IBAN is correct with country prefix
"Leitweg-ID missing"
Cause: This extension does not require a Leitweg-ID for XRechnung generation (B2B usage). If you need B2G submission requirements (Leitweg-ID, routing, portals), handle that in your integration layer.
Solution: Verify required company/contact data and validate the generated XML with your target receiver rules.
"PDF generation failed"
Cause: Magento PDF renderer error
Solution:
- Check Magento's standard PDF works
- Verify all fonts are available
- Check PHP memory limits
"XSD validation failed"
Cause: XML doesn't match schema
Solution:
- Check all required fields are filled
- Verify data formats
- Review validation error details
Logging
Log Location
The extension writes to Magento’s standard logs:
var/log/system.logvar/log/exception.log
Log Contents
- Generation start/end
- Validation steps
- File operations
- Error stack traces (when exceptions occur)
Best Practices
- Keep Block on Error disabled while you validate your setup
- Enable notifications in production
- Enable Retry Failed Generations to auto-recover transient issues
