Skip to content

Commit

Permalink
añado linea log #53 HU08 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
mariasanzs committed Dec 11, 2020
1 parent 208542f commit ef7c428
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sinatra/myapp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,16 @@ class MyApp < Sinatra::Base
begin
productoCompra = @@almacen.buscarProducto(nombreproducto)
begin
log.info "Quitando producto del almacén"
@@almacen.quitarProducto(productoCompra)
status 200
{:quitadoAlmacen => nombreproducto }.to_json
rescue ArgumentError
log.info "ERROR!!! -> Quitando producto del almacén"
status 400
end
rescue StandardError
log.info "ERROR!!! -> Quitando producto del almacén"
status 400
{:status => 'Error: Este producto no está en tu almacen'}.to_json
end
Expand Down Expand Up @@ -201,6 +204,7 @@ class MyApp < Sinatra::Base

error 404 do
content_type :json
log.info "ERROR!!! -> ruta no encontrada"
{:status => 'Error: ruta no encontrada'}.to_json
end
end

0 comments on commit ef7c428

Please sign in to comment.