Skip to content

Commit

Permalink
[SHIBUI-906]
Browse files Browse the repository at this point in the history
Added a logger, removed a stacktrace print.
  • Loading branch information
Bill Smith committed Nov 8, 2018
1 parent 73b9245 commit 313d859
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import com.fasterxml.jackson.databind.ObjectMapper
import edu.internet2.tier.shibboleth.admin.ui.jsonschema.JsonSchemaResourceLocation
import edu.internet2.tier.shibboleth.admin.ui.jsonschema.JsonSchemaResourceLocationRegistry
import edu.internet2.tier.shibboleth.admin.ui.service.JsonSchemaBuilderService
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
Expand All @@ -26,6 +28,8 @@ import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR
@RequestMapping('/api/ui/MetadataSources')
class MetadataSourcesUiDefinitionController {

private static final Logger logger = LoggerFactory.getLogger(MetadataSourcesUiDefinitionController.class);

@Autowired
JsonSchemaResourceLocationRegistry jsonSchemaResourceLocationRegistry

Expand All @@ -47,7 +51,7 @@ class MetadataSourcesUiDefinitionController {
return ResponseEntity.ok(parsedJson)
}
catch (Exception e) {
e.printStackTrace()
logger.error("An error occured while attempting to get json schema for metadata sources!", e)
return ResponseEntity.status(INTERNAL_SERVER_ERROR)
.body([jsonParseError : e.getMessage(),
sourceUiSchemaDefinitionFile: this.jsonSchemaLocation.url])
Expand Down

0 comments on commit 313d859

Please sign in to comment.