Book Image

Ruby on Rails Web Mashup Projects

Book Image

Ruby on Rails Web Mashup Projects

Overview of this book

Table of Contents (14 chapters)
Ruby on Rails Web Mashup Projects
Credits
About the Author
Acknowledgements
About the Reviewer
Preface

Showing nice exception pages


We've just completed a round of six information and utility tabs, and accessed a total of nine mashup APIs to retrieve various kinds of information for a remote location. Almost all the processing is done outside of your own application and the main activities in your application consist of calling the APIs and formatting the returned data. This means that the mashup application we just wrote is highly dependent on the Internet, your external access speed, and the availability of the remote APIs, all of which we normally cannot control.

This also means that exceptions and errors might occur, so controlling and managing exceptions and errors is very important. While it will take too long to start a section on Rails exception handling, a quick solution to this is to catch all exceptions gracefully from Rails and display a friendly message to your user.

Fortunately Rails has a very easy solution to this. ActionController::Rescue, which takes care of exception handling...