Database error reporting improvement
This commit is contained in:
parent
f7ab0b1c57
commit
77121f9a79
2
pom.xml
2
pom.xml
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
<groupId>com.mousetech.gourmet</groupId>
|
<groupId>com.mousetech.gourmet</groupId>
|
||||||
<artifactId>gourmetj</artifactId>
|
<artifactId>gourmetj</artifactId>
|
||||||
<version>0.2.2</version>
|
<version>0.2.4</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>GourmetJ</name>
|
<name>GourmetJ</name>
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||||
import org.primefaces.event.FileUploadEvent;
|
import org.primefaces.event.FileUploadEvent;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.orm.jpa.JpaSystemException;
|
||||||
|
|
||||||
import com.mousetech.gourmetj.persistence.model.Category;
|
import com.mousetech.gourmetj.persistence.model.Category;
|
||||||
import com.mousetech.gourmetj.persistence.model.Ingredient;
|
import com.mousetech.gourmetj.persistence.model.Ingredient;
|
||||||
|
@ -649,9 +649,18 @@ public class RecipeDetailBean implements Serializable {
|
||||||
|
|
||||||
String ingkey = ing.getIngkey();
|
String ingkey = ing.getIngkey();
|
||||||
if (!StringUtils.isEmpty(ingkey)) {
|
if (!StringUtils.isEmpty(ingkey)) {
|
||||||
|
try {
|
||||||
Shopcat scat = this.recipeService
|
Shopcat scat = this.recipeService
|
||||||
.findShopcatForIngredientKey(ingkey);
|
.findShopcatForIngredientKey(ingkey);
|
||||||
ing.setShopCat(scat);
|
ing.setShopCat(scat);
|
||||||
|
} catch (JpaSystemException ex) {
|
||||||
|
String msg = String.format(
|
||||||
|
"Database Error: Unable to fetch info on \"%s\".",
|
||||||
|
ingkey);
|
||||||
|
log.error(msg);
|
||||||
|
JSFUtils.addErrorMessage(msg);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// get ing list size, set ing position, append
|
// get ing list size, set ing position, append
|
||||||
List<IngredientUI> ingredients = getWrappedIngredients();
|
List<IngredientUI> ingredients = getWrappedIngredients();
|
||||||
|
|
|
@ -20,9 +20,6 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
|
||||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
|
|
||||||
|
|
||||||
import jakarta.servlet.DispatcherType;
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
|
|
|
@ -362,8 +362,8 @@
|
||||||
id="ctlAddIng"
|
id="ctlAddIng"
|
||||||
value="+ Add"
|
value="+ Add"
|
||||||
onclick="ingButton(); return false;"
|
onclick="ingButton(); return false;"
|
||||||
>
|
update=":growl"
|
||||||
</p:commandButton>
|
/>
|
||||||
</h:panelGroup>
|
</h:panelGroup>
|
||||||
</p:panel>
|
</p:panel>
|
||||||
</p:tab>
|
</p:tab>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user