Comments (3)
Why not capture the error by using a begin / rescue block?
begin
...#Controller logic
rescue CSV::MalformedCSVError => e
...Error captured into 'e'
end
from comma.
Yep, i did the same but when i give rescue CSV::MalformedCSVError => e, i am getting error. So, i used the following code in the last line, before the end of CSV.foreach statement
rescue CSV::MalformedCSVError
redirect_to administration_institute_users_path,:notice => "error at line #{n+1}, Quotation marks might be improper"
ANy how thanks a lot for your response..
from comma.
Hi @rajkiran, you will need to wrap the entire method, so any initialisation of the CSV should be wrapped. Then its up to you how to handle the rescue.
from comma.
Related Issues (20)
- Fields with line breaks \n HOT 1
- Defining configuration outside of the ActiveRecord model HOT 3
- data formatting methods not called. HOT 1
- Translating boolean values HOT 2
- Printing all fields of array in the same column HOT 1
- Why does sorting trigger a warning? HOT 7
- Version 4.3.1 - ArgumentError: Polymorphic association does not support to compute class. HOT 4
- Ruby 2.7 keywaord arguments deprecation warnings
- Migrate to GitHub Actions HOT 2
- Using comma with padrino ruby framework HOT 2
- Dynamic Columns with headers HOT 3
- Header extraction failing with helper class HOT 2
- Breaking changes? HOT 2
- Comma uses wrong comma block on single table inheritance in Rails HOT 7
- Can i dynamically select options for export? HOT 1
- Crash on class-level .to_comma_headers HOT 1
- Umlauts correct in CSV file, but Excel misinterprets them. Can I tell Excel the format? HOT 2
- Rails/RSpec/Capybara: Test raises "Missing template errors/internal_server_error} HOT 2
- Easy i18n of column headers HOT 1
- Exporting with BOM HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from comma.