# How to reproduce error System error (Failure) Imap

**URL:** <https://www.ruby-forum.com/t/how-to-reproduce-error-system-error-failure-imap/224995>\
**Category:** Ruby\
**Created:** [December 6, 2012, 10:47am UTC](https://www.ruby-forum.com/t/how-to-reproduce-error-system-error-failure-imap/224995 "2012-12-06T10:47:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [December 6, 2012, 10:47am UTC](https://www.ruby-forum.com/t/how-to-reproduce-error-system-error-failure-imap/224995/1 "2012-12-06T10:47:07Z")

</div>

Hi friends,  
Am using Imap in ruby 1.8.7  
I got error ERROR (12791) System error (Failure) in my code.  
But not sure when this will be happen.  
Can anyone suggest when this error will be raise and how to reproduce  
this error.

---

<div class="post-metadata">

**Author:** ![lucky1234](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d07c76/32.png) [@lucky1234](https://www.ruby-forum.com/u/lucky1234)\
**Post date:** [December 6, 2012, 3:57pm UTC](https://www.ruby-forum.com/t/how-to-reproduce-error-system-error-failure-imap/224995/2 "2012-12-06T15:57:58Z")

</div>

unsubscribe

---

<div class="post-metadata">

**Author:** ![lucky1234](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d07c76/32.png) [@lucky1234](https://www.ruby-forum.com/u/lucky1234)\
**Post date:** [December 6, 2012, 7:33pm UTC](https://www.ruby-forum.com/t/how-to-reproduce-error-system-error-failure-imap/224995/3 "2012-12-06T19:33:35Z")

</div>

unsubscribe

From: Jason Dunn [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
Sent: Thursday, December 06, 2012 4:58 PM  
To: ruby-talk ML  
Subject: Re: how to reproduce error System error (Failure) Imap

unsubscribe

On Dec 6, 2012 3:47 AM, “Lucky Nl” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

Hi friends,  
Am using Imap in ruby 1.8.7  
I got error ERROR (12791) System error (Failure) in my code.  
But not sure when this will be happen.  
Can anyone suggest when this error will be raise and how to reproduce  
this error.

---

<div class="post-metadata">

**Author:** ![lucky1234](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d07c76/32.png) [@lucky1234](https://www.ruby-forum.com/u/lucky1234)\
**Post date:** [December 6, 2012, 11:58pm UTC](https://www.ruby-forum.com/t/how-to-reproduce-error-system-error-failure-imap/224995/4 "2012-12-06T23:58:52Z")

</div>

On Dec 6, 2012, at 01:47 , Lucky Nl [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Am using Imap in ruby 1.8.7  
> I got error ERROR (12791) System error (Failure) in my code.  
> But not sure when this will be happen.  
> Can anyone suggest when this error will be raise and how to reproduce  
> this error.

If you look through the code of net/imap.rb you’ll see that there is no  
occurrence of “ERROR” anywhere. Nor in digest nor ssl. You’ll need to  
look at your backtrace and actually debug where this is coming from.

---

<div class="post-metadata">

**Author:** ![lucky1234](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d07c76/32.png) [@lucky1234](https://www.ruby-forum.com/u/lucky1234)\
**Post date:** [December 7, 2012, 2:41pm UTC](https://www.ruby-forum.com/t/how-to-reproduce-error-system-error-failure-imap/224995/5 "2012-12-07T14:41:50Z")

</div>

On Thu, Dec 6, 2012 at 11:35 PM, Lucky Nl [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > occurrence of “ERROR” anywhere. Nor in digest nor ssl. You’ll need to  
> > look at your backtrace and actually debug where this is coming from.
> 
> This issue raised at line in my code imap.examine(“[Gmail]/Sent Mail”)  
> I have use rescue Exception =\> e  
> But this hadn’t come to this block
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Really hard to debug code without seeing it, but…

Generally when these things happen, it’s because of passing in bad  
references and so on. Make sure you are checking all error returns and  
trapping the exceptions you can.

Break down the code to small enough components you can test each one  
by itself (and test first, early and often!).

Are you stuck using 1.8.7? 1.9.x are _so_ much better.

You can help us help you tremendously by showing us the real code and  
the backtrace listings.

---

<div class="post-metadata">

**Author:** ![lucky1234](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d07c76/32.png) [@lucky1234](https://www.ruby-forum.com/u/lucky1234)\
**Post date:** [December 7, 2012, 6:35am UTC](https://www.ruby-forum.com/t/how-to-reproduce-error-system-error-failure-imap/224995/6 "2012-12-07T06:35:09Z")

</div>

Ryan D. wrote in post #1088127:

> On Dec 6, 2012, at 01:47 , Lucky Nl [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Am using Imap in ruby 1.8.7  
> > I got error ERROR (12791) System error (Failure) in my code.  
> > But not sure when this will be happen.  
> > Can anyone suggest when this error will be raise and how to reproduce  
> > this error.
> 
> If you look through the code of net/imap.rb you’ll see that there is no  
> occurrence of “ERROR” anywhere. Nor in digest nor ssl. You’ll need to  
> look at your backtrace and actually debug where this is coming from.

This issue raised at line in my code imap.examine(“[Gmail]/Sent Mail”)  
in production.  
But when i have tried same code ,not get error  
I have use rescue Exception =\> e  
But this hadn’t come to this block
