All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.genexus.ws.GXRestJsonMappingException Maven / Gradle / Ivy

Go to download

Core classes for the runtime used by Java and Android apps generated with GeneXus

The newest version!
package com.genexus.ws;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

import com.fasterxml.jackson.databind.JsonMappingException;
import com.genexus.WrapperUtils;
import javax.annotation.Priority;

@Provider
@Priority(1)
public class GXRestJsonMappingException extends Throwable implements ExceptionMapper
{
	private static final long serialVersionUID = 1L;

	@Override
	public Response toResponse(JsonMappingException ex)
	{
		int statusCode[] = {0};
		String jsonString = WrapperUtils.getJsonFromRestException(statusCode, "", false, ex);
		return Response.status(statusCode[0]).entity(jsonString).type("application/json").build();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy