• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamephpguicwindows翻訳pythonomegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

Voice data server for navigation voice changer app.


Commit MetaInfo

Revision5400ca6195dab1498b7d08927fedc74fd27726e8 (tree)
Time2017-11-11 16:45:02
AuthorHMML <hmml3939@gmai...>
CommiterHMML

Log Message

Handle error on audio preview generation.

Change Summary

Incremental Difference

--- a/app/controllers/navi_voices_controller.rb
+++ b/app/controllers/navi_voices_controller.rb
@@ -36,8 +36,15 @@ class NaviVoicesController < ApplicationController
3636 # POST /navi_voices
3737 # POST /navi_voices.json
3838 def create
39- @navi_voice = NaviVoice.new(navi_voice_params)
40- @navi_voice.save
39+ begin
40+ @navi_voice = NaviVoice.new(navi_voice_params)
41+ @navi_voice.save
42+ rescue Paperclip::Error => e
43+ np = navi_voice_params.dup
44+ np.delete(:archive)
45+ @navi_voice ||= NaviVoice.new(np)
46+ @navi_voice.errors[:archive] = e.message
47+ end
4148 respond_with @navi_voice, location: navi_voices_path
4249 end
4350