# Colored error messages

**URL:** <https://www.ruby-forum.com/t/colored-error-messages/78704>\
**Category:** Ruby\
**Created:** [December 7, 2006, 11:48pm UTC](https://www.ruby-forum.com/t/colored-error-messages/78704 "2006-12-07T23:48:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [December 7, 2006, 11:48pm UTC](https://www.ruby-forum.com/t/colored-error-messages/78704/1 "2006-12-07T23:48:44Z")

</div>

Hi,

Does anyone know whether it is possible to write code which shows me  
colored error messages after the validation detects an error?

Regards,  
Y

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [December 7, 2006, 11:51pm UTC](https://www.ruby-forum.com/t/colored-error-messages/78704/2 "2006-12-07T23:51:20Z")

</div>

On Dec 7, 2006, at 14:48 , Yu Co wrote:

> Does anyone know whether it is possible to write code which shows me  
> colored error messages after the validation detects an error?

I’m pretty sure you have the wrong mailing list, but I have no idea  
which one you want.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)

I LIT YOUR GEM ON FIRE!

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [December 8, 2006, 12:45am UTC](https://www.ruby-forum.com/t/colored-error-messages/78704/3 "2006-12-08T00:45:04Z")

</div>

Eric H. wrote:

> On Dec 7, 2006, at 14:48 , Yu Co wrote:
> 
> > Does anyone know whether it is possible to write code which shows me  
> > colored error messages after the validation detects an error?
> 
> I’m pretty sure you have the wrong mailing list, but I have no idea  
> which one you want.

OP probably wanted the Ruby on Rails list.

Nevertheless, I’ve been pondering lately how effective would the act of  
colorizing error messages and stack traces be against “scroll blindness”  
(when lots of output scrolls by on your terminal and you have to hunt  
around for relevant information)?

It might be interesting to try.

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [December 8, 2006, 4:27am UTC](https://www.ruby-forum.com/t/colored-error-messages/78704/4 "2006-12-08T04:27:52Z")

</div>

Have I understand you correct that colored error message r not possible  
yet?

Wilson B. wrote:

> On 12/7/06, Suraj K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Nevertheless, I’ve been pondering lately how effective would the act of  
> > colorizing error messages and stack traces be against “scroll blindness”  
> > (when lots of output scrolls by on your terminal and you have to hunt  
> > around for relevant information)?
> > 
> > It might be interesting to try.
> 
> In Rubinius, backtraces are instances of the Backtrace class, and they  
> have methods you can override. Stay tuned, and you could make a  
> colorized one. Heh

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [December 8, 2006, 1:11am UTC](https://www.ruby-forum.com/t/colored-error-messages/78704/5 "2006-12-08T01:11:30Z")

</div>

On 12/7/06, Suraj K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Nevertheless, I’ve been pondering lately how effective would the act of  
> colorizing error messages and stack traces be against “scroll blindness”  
> (when lots of output scrolls by on your terminal and you have to hunt  
> around for relevant information)?
> 
> It might be interesting to try.

In Rubinius, backtraces are instances of the Backtrace class, and they  
have methods you can override. Stay tuned, and you could make a  
colorized one. Heh

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [December 8, 2006, 5:21am UTC](https://www.ruby-forum.com/t/colored-error-messages/78704/6 "2006-12-08T05:21:48Z")

</div>

Yu Co [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> Hi,
> 
> Does anyone know whether it is possible to write code which shows me  
> colored error messages after the validation detects an error?
> 
> Regards,  
> Y

the script “script/server” of rails framework can do this,just read it.

–  
For some reasons,my EMail had been changed to “KDr2[#][163.com](http://163.com)” now…

NO GNUS is Bad News.

```
                                           ------yours Killy Draw

```

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [December 8, 2006, 4:41am UTC](https://www.ruby-forum.com/t/colored-error-messages/78704/7 "2006-12-08T04:41:45Z")

</div>

No, they are possible. According to the other posters, you can just  
override the Exception/Backtrace class.

Dan

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [December 11, 2006, 12:18am UTC](https://www.ruby-forum.com/t/colored-error-messages/78704/8 "2006-12-11T00:18:11Z")

</div>

Where can I find the Exception/Backtrace class?  
Never heard of them before?

Daniel F. wrote:

> No, they are possible. According to the other posters, you can just  
> override the Exception/Backtrace class.
> 
> Dan
