{"id":160,"date":"2019-09-24T07:57:39","date_gmt":"2019-09-24T07:57:39","guid":{"rendered":"http:\/\/sumitjangid.com\/?p=160"},"modified":"2019-09-24T08:03:46","modified_gmt":"2019-09-24T08:03:46","slug":"exception-handlingtry-catch","status":"publish","type":"post","link":"http:\/\/sumitjangid.com\/index.php\/2019\/09\/24\/exception-handlingtry-catch\/","title":{"rendered":"Exception Handling(Try Catch)"},"content":{"rendered":"\n<h2>SQL Server&nbsp;<code>TRY CATCH<\/code>&nbsp;overview<\/h2>\n\n\n\n<p>The&nbsp;<code>TRY CATCH<\/code>&nbsp;construct allows you to gracefully handle exceptions in SQL Server. To use the&nbsp;<code>TRY CATCH<\/code>&nbsp;construct, you first place a group of Transact-SQL statements that could cause an exception in a&nbsp;<code>BEGIN TRY...END TRY<\/code>&nbsp;block as follows:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>123<\/td><td>BEGIN TRY&nbsp;&nbsp;&nbsp;&nbsp; <em>&#8212; statements that may cause exceptions<\/em>END TRY&nbsp;&nbsp;<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Then you use a&nbsp;<code>BEGIN CATCH...END CATCH<\/code>&nbsp;block immediately after the&nbsp;<code>TRY<\/code>&nbsp;block:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>123<\/td><td>BEGIN CATCH&nbsp;&nbsp;&nbsp;&nbsp; <em>&#8212; statements that handle exception<\/em>END CATCH&nbsp;&nbsp;<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>The following illustrates a complete&nbsp;<code>TRY CATCH<\/code>&nbsp;construct:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>123456<\/td><td>BEGIN TRY&nbsp;&nbsp;&nbsp;&nbsp; <em>&#8212; statements that may cause exceptions<\/em>END TRY BEGIN CATCH&nbsp;&nbsp;&nbsp;&nbsp; <em>&#8212; statements that handle exception<\/em>END CATCH&nbsp;&nbsp;<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>If the statements between the&nbsp;<code>TRY<\/code>&nbsp;block complete without an error, the statements between the&nbsp;<code>CATCH<\/code>&nbsp;block will not execute. However, if any statement inside the&nbsp;<code>TRY<\/code>&nbsp;block causes an exception, the control transfers to the statements in the&nbsp;<code>CATCH<\/code>&nbsp;block.<\/p>\n\n\n\n<h3>The&nbsp;<code>CATCH<\/code>&nbsp;block functions<\/h3>\n\n\n\n<p>Inside the&nbsp;<code>CATCH<\/code>&nbsp;block, you can use the following functions to get the detailed information on the error that occurred:<\/p>\n\n\n\n<ul><li><code>ERROR_LINE()<\/code>&nbsp;returns the line number on which the exception occurred.<\/li><li><code>ERROR_MESSAGE()<\/code>&nbsp;returns the complete text of the generated error message.<\/li><li><code>ERROR_PROCEDURE()<\/code>&nbsp;returns the name of the stored procedure or trigger where the error occurred.<\/li><li><code>ERROR_NUMBER()<\/code>&nbsp;returns the number of the error that occurred.<\/li><li><code>ERROR_SEVERITY()<\/code>&nbsp;returns the severity level of the error that occurred.<\/li><li><code>ERROR_STATE()<\/code>&nbsp;returns the state number of the error that occurred.<\/li><\/ul>\n\n\n\n<p>Note that you only use these functions in the&nbsp;<code>CATCH<\/code>&nbsp;block. If you use them outside of the&nbsp;<code>CATCH<\/code>&nbsp;block, all of these functions will return&nbsp;<code><a href=\"http:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-null\/\">NULL<\/a><\/code>.<\/p>\n\n\n\n<h3>Nested&nbsp;<code>TRY CATCH<\/code>&nbsp;constructs<\/h3>\n\n\n\n<p>You can nest&nbsp;<code>TRY CATCH<\/code>&nbsp;construct inside another&nbsp;<code>TRY CATCH<\/code>&nbsp;construct. However, either a&nbsp;<code>TRY<\/code>&nbsp;block or a&nbsp;<code>CATCH<\/code>&nbsp;block can contain a nested&nbsp;<code>TRY CATCH<\/code>, for example:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>123456789101112<\/td><td>BEGIN TRY&nbsp;&nbsp;&nbsp;&nbsp;<em>&#8212; statements that may cause exceptions<\/em>END TRYBEGIN CATCH&nbsp;&nbsp;&nbsp;&nbsp;<em>&#8212; statements to handle exception<\/em>&nbsp;&nbsp;&nbsp;&nbsp;BEGIN TRY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&#8212; nested TRY block<\/em>&nbsp;&nbsp;&nbsp;&nbsp;END TRY&nbsp;&nbsp;&nbsp;&nbsp;BEGIN CATCH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&#8212; nested CATCH block<\/em>&nbsp;&nbsp;&nbsp;&nbsp;END CATCHEND CATCH<\/td><\/tr><\/tbody><\/table>\n\n\n\n<h2>SQL Server&nbsp;<code>TRY CATCH<\/code>&nbsp;examples<\/h2>\n\n\n\n<p>First,&nbsp;<a href=\"http:\/\/www.sqlservertutorial.net\/sql-server-stored-procedures\/basic-sql-server-stored-procedures\/\">create a stored procedure<\/a>&nbsp;named&nbsp;<code>usp_divide<\/code>&nbsp;that divides two numbers:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>1234567891011121314151617181920<\/td><td>CREATE PROC usp_divide(&nbsp;&nbsp;&nbsp;&nbsp;@a decimal,&nbsp;&nbsp;&nbsp;&nbsp;@b decimal,&nbsp;&nbsp;&nbsp;&nbsp;@c decimal output) ASBEGIN&nbsp;&nbsp;&nbsp;&nbsp;BEGIN TRY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SET @c = @a \/ @b;&nbsp;&nbsp;&nbsp;&nbsp;END TRY&nbsp;&nbsp;&nbsp;&nbsp;BEGIN CATCH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ERROR_NUMBER() AS ErrorNumber&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_SEVERITY() AS ErrorSeverity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_STATE() AS ErrorState&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_PROCEDURE() AS ErrorProcedure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_LINE() AS ErrorLine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_MESSAGE() AS ErrorMessage;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END CATCHEND;GO<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>In this stored procedure, we placed the formula inside the&nbsp;<code>TRY<\/code>&nbsp;block and called the&nbsp;<code>CATCH<\/code>&nbsp;block functions&nbsp;<code>ERROR_*<\/code>&nbsp;inside the&nbsp;<code>CATCH<\/code>&nbsp;block.<\/p>\n\n\n\n<p>Second, call the&nbsp;<code>usp_divide<\/code>&nbsp;stored procedure to divide 10 by 2:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>123<\/td><td>DECLARE @r decimal;EXEC usp_divide 10, 2, @r output;PRINT @r;<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Here is the output<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>1<\/td><td>5<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Because no exception occurred in the&nbsp;<code>TRY<\/code>&nbsp;block, the stored procedure completed at the&nbsp;<code>TRY<\/code>&nbsp;block.<\/p>\n\n\n\n<p>Third, attempt to divide 20 by zero by calling the&nbsp;<code>usp_divide<\/code>&nbsp;stored procedure:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>123<\/td><td>DECLARE @r2 decimal;EXEC usp_divide 10, 0, @r2 output;PRINT @r2;<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>The following picture shows the output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-TRY-CATCH-Example.png\" alt=\"SQL Server TRY CATCH Example\" class=\"wp-image-1900\"\/><\/figure>\n\n\n\n<p>Because of division by zero error which was caused by the formula, the control was passed to the statement inside the&nbsp;<code>CATCH<\/code>&nbsp;block which returned the error\u2019s detailed information.<\/p>\n\n\n\n<h2>SQL Serer&nbsp;<code>TRY CATCH<\/code>&nbsp;with transactions<\/h2>\n\n\n\n<p>Inside a&nbsp;<code>CATCH<\/code>&nbsp;block, you can test the state of transactions by using the&nbsp;<code>XACT_STATE()<\/code>&nbsp;function.<\/p>\n\n\n\n<ul><li>If the&nbsp;<code>XACT_STATE()<\/code>&nbsp;function returns -1, it means that an uncommittable transaction is pending, you should issue a&nbsp;<code>ROLLBACK TRANSACTION<\/code>&nbsp;statement.<\/li><li>In case the&nbsp;<code>XACT_STATE()<\/code>&nbsp;function returns 1, it means that a committable transaction is pending. You can issue a&nbsp;<code>COMMIT TRANSACTION<\/code>&nbsp;statement in this case.<\/li><li>If the&nbsp;<code>XACT_STATE()<\/code>&nbsp;function return 0, it means no transaction is pending, therefore, you don\u2019t need to take any action.<\/li><\/ul>\n\n\n\n<p>It is a good practice to test your transaction state before issuing a&nbsp;<code>COMMIT TRANSACTION<\/code>&nbsp;or&nbsp;<code>ROLLBACK TRANSACTION<\/code>&nbsp;statement in a&nbsp;<code>CATCH<\/code>&nbsp;block to ensure consistency.<\/p>\n\n\n\n<h3>Using&nbsp;<code>TRY CATCH<\/code>&nbsp;with transactions example<\/h3>\n\n\n\n<p>First, set up two new tables&nbsp;<code>sales.persons<\/code>&nbsp;and&nbsp;<code>sales.deals<\/code>&nbsp;for demonstration:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>12345678910111213141516171819202122232425262728<\/td><td>CREATE TABLE sales.persons(&nbsp;&nbsp;&nbsp;&nbsp;person_id&nbsp;&nbsp;INT&nbsp;&nbsp;&nbsp;&nbsp;PRIMARY KEY IDENTITY, &nbsp;&nbsp;&nbsp;&nbsp;first_name NVARCHAR(100) NOT NULL, &nbsp;&nbsp;&nbsp;&nbsp;last_name&nbsp;&nbsp;NVARCHAR(100) NOT NULL);&nbsp;CREATE TABLE sales.deals(&nbsp;&nbsp;&nbsp;&nbsp;deal_id&nbsp;&nbsp; INT&nbsp;&nbsp;&nbsp;&nbsp;PRIMARY KEY IDENTITY, &nbsp;&nbsp;&nbsp;&nbsp;person_id INT NOT NULL, &nbsp;&nbsp;&nbsp;&nbsp;deal_note NVARCHAR(100), &nbsp;&nbsp;&nbsp;&nbsp;FOREIGN KEY(person_id) REFERENCES sales.persons(&nbsp;&nbsp;&nbsp;&nbsp;person_id));&nbsp;insert into &nbsp;&nbsp;&nbsp;&nbsp;sales.persons(first_name, last_name)values&nbsp;&nbsp;&nbsp;&nbsp;(&#8216;John&#8217;,&#8217;Doe&#8217;),&nbsp;&nbsp;&nbsp;&nbsp;(&#8216;Jane&#8217;,&#8217;Doe&#8217;);&nbsp;insert into &nbsp;&nbsp;&nbsp;&nbsp;sales.deals(person_id, deal_note)values&nbsp;&nbsp;&nbsp;&nbsp;(1,&#8217;Deal for John Doe&#8217;);<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Next, create a new stored procedure named&nbsp;<code>usp_report_error<\/code>&nbsp;that will be used in a&nbsp;<code>CATCH<\/code>&nbsp;block to report the detailed information of an error:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>12345678910<\/td><td>CREATE PROC usp_report_errorAS&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ERROR_NUMBER() AS ErrorNumber&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_SEVERITY() AS ErrorSeverity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_STATE() AS ErrorState&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_LINE () AS ErrorLine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_PROCEDURE() AS ErrorProcedure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,ERROR_MESSAGE() AS ErrorMessage;&nbsp;&nbsp;GO<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Then, develop a new stored procedure that deletes a row from the&nbsp;<code>sales.persons<\/code>&nbsp;table:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>12345678910111213141516171819202122232425262728293031323334<\/td><td>CREATE PROC usp_delete_person(&nbsp;&nbsp;&nbsp;&nbsp;@person_id INT) ASBEGIN&nbsp;&nbsp;&nbsp;&nbsp;BEGIN TRY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BEGIN TRANSACTION;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&#8212; delete the person<\/em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DELETE FROM sales.persons &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE person_id = @person_id;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&#8212; if DELETE succeeds, commit the transaction<\/em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COMMIT TRANSACTION;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END TRY&nbsp;&nbsp;&nbsp;&nbsp;BEGIN CATCH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&#8212; report exception<\/em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EXEC usp_report_error;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&#8212; Test if the transaction is uncommittable.&nbsp;&nbsp;<\/em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF (XACT_STATE()) = -1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BEGIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PRINT&nbsp;&nbsp;N&#8217;The transaction is in an uncommittable state.&#8217; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8216;Rolling back transaction.&#8217;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ROLLBACK TRANSACTION;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&#8212; Test if the transaction is committable.&nbsp;&nbsp;<\/em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF (XACT_STATE()) = 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BEGIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PRINT N&#8217;The transaction is committable.&#8217; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8216;Committing transaction.&#8217;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COMMIT TRANSACTION;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END CATCHEND;GO<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>In this stored procedure, we used the&nbsp;<code>XACT_STATE()<\/code>&nbsp;function to check the state of the transaction before performing&nbsp;<code>COMMIT TRANSACTION<\/code>&nbsp;or&nbsp;<code>ROLLBACK TRANSACTION<\/code>&nbsp;inside the&nbsp;<code>CATCH<\/code>&nbsp;block.<\/p>\n\n\n\n<p>After that, call the&nbsp;<code>usp_delete_person<\/code>&nbsp;stored procedure to delete the person id 2:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>1<\/td><td>EXEC usp_delete_person 2;<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>There was no exception occurred.<\/p>\n\n\n\n<p>Finally, call the stored procedure&nbsp;<code>usp_delete_person<\/code>&nbsp;to delete person id 1:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>1<\/td><td>EXEC usp_delete_person 1;<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>The following error occurred:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-TRY-CATCH-Transaction-Example.png\" alt=\"SQL Server TRY CATCH Transaction Example\" class=\"wp-image-1901\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>SQL Server&nbsp;TRY CATCH&nbsp;overview The&nbsp;TRY CATCH&nbsp;construct allows you to gracefully handle exceptions in SQL Server. To use the&nbsp;TRY CATCH&nbsp;construct, you first place a group of Transact-SQL statements that could cause an exception in a&nbsp;BEGIN TRY&#8230;END TRY&nbsp;block&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,18,19],"tags":[],"_links":{"self":[{"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/posts\/160"}],"collection":[{"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":1,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":161,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/posts\/160\/revisions\/161"}],"wp:attachment":[{"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sumitjangid.com\/index.php\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}